-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Don't depend to ctypes on Linux #2079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I also reported the issue to colorama: |
This should be fixed in development already, see https://github.com/pypa/pip/blob/develop/pip/utils/logging.py#L15-L20. |
Note that "fixed" means you won't get any colors at all. |
It looks like the issue was already fixed in colorama 0.3.2: colorama issue #56. This version handles the ImportError on "import ctypes". It's maybe time to upgrade this bundled module? |
We've done that in development branch too: https://github.com/pypa/pip/blob/develop/pip/_vendor/vendor.txt#L4 |
Hi,
On CPython buildbot "FreeBSD 7.2, the compilation of the ctypes module fails. The pip module cannot be used because it imports colorama which uses ctypes for its win32 module, and the win32 module is always imported, even on Linux. IMO it would be better to not import this module on Linux to avoid the dependency to ctypes.
I know that the issue comes from colorama, but I hope that the issue will get more attention if it reported to pip.
Test output on the buildbot:
FAIL: test_with_pip (test.test_venv.EnsurePipTest)
Traceback (most recent call last):
File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/test_venv.py", line 357, in test_with_pip
with_pip=True)
subprocess.CalledProcessError: Command '['/tmp/tmp71gop0m5/bin/python', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/test_venv.py", line 363, in test_with_pip
self.fail(msg.format(exc, details))
AssertionError: Command '['/tmp/tmp71gop0m5/bin/python', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1
Subprocess Output
Traceback (most recent call last):
File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/runpy.py", line 170, in _run_module_as_main
"main", mod_spec)
File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/ensurepip/main.py", line 4, in
ensurepip._main()
File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/ensurepip/init.py", line 209, in _main
default_pip=args.default_pip,
File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/ensurepip/init.py", line 116, in bootstrap
_run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/ensurepip/init.py", line 40, in _run_pip
import pip
File "/tmp/tmplhy261sg/pip-1.5.6-py2.py3-none-any.whl/pip/init.py", line 9, in
File "/tmp/tmplhy261sg/pip-1.5.6-py2.py3-none-any.whl/pip/log.py", line 9, in
File "/tmp/tmplhy261sg/pip-1.5.6-py2.py3-none-any.whl/pip/_vendor/colorama/init.py", line 2, in
File "/tmp/tmplhy261sg/pip-1.5.6-py2.py3-none-any.whl/pip/_vendor/colorama/initialise.py", line 5, in
File "/tmp/tmplhy261sg/pip-1.5.6-py2.py3-none-any.whl/pip/_vendor/colorama/ansitowin32.py", line 6, in
File "/tmp/tmplhy261sg/pip-1.5.6-py2.py3-none-any.whl/pip/_vendor/colorama/winterm.py", line 2, in
File "/tmp/tmplhy261sg/pip-1.5.6-py2.py3-none-any.whl/pip/_vendor/colorama/win32.py", line 7, in
File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/ctypes/init.py", line 7, in
from _ctypes import Union, Structure, Array
ImportError: No module named '_ctypes'
The text was updated successfully, but these errors were encountered: