[GH-ISSUE #1986] pip freeze not working in my virtual env, instead it is showing this! #1486

Closed
opened 2026-02-27 11:17:21 +03:00 by kerem · 3 comments
Owner

Originally created by @yashjain0 on GitHub (Jul 5, 2020).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1986

(chinu) abitribe@yashmacbook chinu % pip freeze
Traceback (most recent call last):
File "/Users/abitribe/Desktop/chinu/bin/pip", line 8, in
sys.exit(main())
File "/Users/abitribe/Desktop/chinu/lib/python2.7/site-packages/pip/_internal/cli/main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "/Users/abitribe/Desktop/chinu/lib/python2.7/site-packages/pip/_internal/commands/init.py", line 104, in create_command
module = importlib.import_module(module_path)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/Users/abitribe/Desktop/chinu/lib/python2.7/site-packages/pip/_internal/commands/freeze.py", line 12, in
from pip._internal.operations.freeze import freeze
File "/Users/abitribe/Desktop/chinu/lib/python2.7/site-packages/pip/_internal/operations/freeze.py", line 16, in
from pip._internal.req.constructors import (
File "/Users/abitribe/Desktop/chinu/lib/python2.7/site-packages/pip/_internal/req/init.py", line 12, in
from .req_install import InstallRequirement
File "/Users/abitribe/Desktop/chinu/lib/python2.7/site-packages/pip/_internal/req/req_install.py", line 30, in
from pip._internal.operations.install.wheel import install_wheel
File "/Users/abitribe/Desktop/chinu/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.py", line 25, in
from pip._vendor.distlib.scripts import ScriptMaker
File "/Users/abitribe/Desktop/chinu/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py", line 14, in
from .compat import sysconfig, detect_encoding, ZipFile
ImportError: No module named compat

Originally created by @yashjain0 on GitHub (Jul 5, 2020). Original GitHub issue: https://github.com/modoboa/modoboa/issues/1986 (chinu) abitribe@yashmacbook chinu % pip freeze Traceback (most recent call last): File "/Users/abitribe/Desktop/chinu/bin/pip", line 8, in <module> sys.exit(main()) File "/Users/abitribe/Desktop/chinu/lib/python2.7/site-packages/pip/_internal/cli/main.py", line 73, in main command = create_command(cmd_name, isolated=("--isolated" in cmd_args)) File "/Users/abitribe/Desktop/chinu/lib/python2.7/site-packages/pip/_internal/commands/__init__.py", line 104, in create_command module = importlib.import_module(module_path) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/Users/abitribe/Desktop/chinu/lib/python2.7/site-packages/pip/_internal/commands/freeze.py", line 12, in <module> from pip._internal.operations.freeze import freeze File "/Users/abitribe/Desktop/chinu/lib/python2.7/site-packages/pip/_internal/operations/freeze.py", line 16, in <module> from pip._internal.req.constructors import ( File "/Users/abitribe/Desktop/chinu/lib/python2.7/site-packages/pip/_internal/req/__init__.py", line 12, in <module> from .req_install import InstallRequirement File "/Users/abitribe/Desktop/chinu/lib/python2.7/site-packages/pip/_internal/req/req_install.py", line 30, in <module> from pip._internal.operations.install.wheel import install_wheel File "/Users/abitribe/Desktop/chinu/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.py", line 25, in <module> from pip._vendor.distlib.scripts import ScriptMaker File "/Users/abitribe/Desktop/chinu/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py", line 14, in <module> from .compat import sysconfig, detect_encoding, ZipFile ImportError: No module named compat
kerem closed this issue 2026-02-27 11:17:21 +03:00
Author
Owner

@tonioo commented on GitHub (Jul 23, 2020):

@luciferon Have you updated pip?

<!-- gh-comment-id:662977595 --> @tonioo commented on GitHub (Jul 23, 2020): @luciferon Have you updated pip?
Author
Owner

@yashjain0 commented on GitHub (Sep 14, 2020):

By the way the answer was simple, we have to create a virtualenv using
" virtualenv -p python3 "
this will create a virtaulenv with python3 as default python version and hence the code will run!

<!-- gh-comment-id:691810921 --> @yashjain0 commented on GitHub (Sep 14, 2020): By the way the answer was simple, we have to create a virtualenv using **" virtualenv -p python3 "** this will create a virtaulenv with python3 as default python version and hence the code will run!
Author
Owner

@yashjain0 commented on GitHub (Sep 14, 2020):

@luciferon Have you updated pip?

yes I have!

<!-- gh-comment-id:691811118 --> @yashjain0 commented on GitHub (Sep 14, 2020): > @luciferon Have you updated pip? yes I have!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#1486
No description provided.