Skip to content
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

Not working at all #2207

Closed
Yuri6037 opened this issue Oct 5, 2021 · 3 comments
Closed

Not working at all #2207

Yuri6037 opened this issue Oct 5, 2021 · 3 comments
Labels

Comments

@Yuri6037
Copy link

Yuri6037 commented Oct 5, 2021

Issue

When making a virtualenv using virtualenv -p python3.8 ./venv virtualenv claims that the virtual environment is ready. Run source ./venv/bin/activate which will also work.
Then attempt to run python3 --version which should also work and say 3.8.x. However now try pip --version and boom error: ModuleNotFoundError: No module named 'distutils.cmd'. Basically virtualenv generates broken pip. The system package python3-distutils is already installed.

Environment

Provide at least:

  • OS: Pop OS 21.04

  • pip list of the host python where virtualenv is installed:

Package Version


argon2-cffi 20.1.0
attrs 21.2.0
backcall 0.2.0
backports.entry-points-selectable 1.1.0
bleach 4.1.0
blinker 1.4
Brlapi 0.8.2
certifi 2020.6.20
cffi 1.14.6
chardet 4.0.0
chrome-gnome-shell 0.0.0
click 7.1.2
colorama 0.4.4
command-not-found 0.3
cryptography 3.3.2
cupshelpers 1.0
dbus-python 1.2.16
debugpy 1.4.1
decorator 5.0.9
defer 1.0.6
defusedxml 0.7.1
distlib 0.3.3
distro 1.5.0
entrypoints 0.3
evdev 1.4.0
filelock 3.3.0
gyp 0.1
hidpidaemon 18.4.6
httplib2 0.18.1
idna 2.10
ipykernel 6.2.0
ipython 7.26.0
ipython-genutils 0.2.0
jedi 0.18.0
jeepney 0.6.0
Jinja2 3.0.1
jsonschema 3.2.0
jupyter-client 7.0.1
jupyter-core 4.7.1
jupyterlab-pygments 0.1.2
kazam 1.4.5
kernelstub 3.1.4
keyring 22.2.0
language-selector 0.1
launchpadlib 1.10.13
lazr.restfulclient 0.14.2
lazr.uri 1.0.5
louis 3.16.0
macaroonbakery 1.3.1
Mako 1.1.3
MarkupSafe 2.0.1
matplotlib-inline 0.1.2
mistune 0.8.4
nbclient 0.5.4
nbconvert 6.1.0
nbformat 5.1.3
nest-asyncio 1.5.1
netifaces 0.10.9
oauthlib 3.1.0
packaging 21.0
pandocfilters 1.4.3
parso 0.8.2
pexpect 4.8.0
pickleshare 0.7.5
pip 20.3.4
platformdirs 2.4.0
pop-transition 1.1.2
prometheus-client 0.11.0
prompt-toolkit 3.0.20
protobuf 3.12.4
ptyprocess 0.7.0
pycairo 1.16.2
pycparser 2.20
pycups 2.0.1
pydbus 0.6.0
Pygments 2.10.0
PyGObject 3.38.0
PyJWT 1.7.1
pymacaroons 0.13.0
PyNaCl 1.4.0
pyparsing 2.4.7
pyRFC3339 1.1
pyrsistent 0.18.0
python-apt 2.2.0-ubuntu0.21.04.1
python-dateutil 2.8.2
python-debian 0.1.39
python-xlib 0.29
pytz 2021.1
pyxdg 0.27
PyYAML 5.3.1
pyzmq 22.2.1
repolib 1.5.2
repoman 1.4.0
requests 2.25.1
screen-resolution-extra 0.0.0
SecretStorage 3.3.1
Send2Trash 1.8.0
sessioninstaller 0.0.0
setuptools 52.0.0
simplejson 3.17.2
six 1.15.0
system76driver 20.4.42
systemd-python 234
terminado 0.11.1
testpath 0.5.0
tornado 6.1
traitlets 5.0.5
ubuntu-advantage-tools 27.2
ubuntu-drivers-common 0.0.0
ufw 0.36
urllib3 1.26.2
virtualenv 20.8.1
wadllib 1.3.5
wcwidth 0.2.5
webencodings 0.5.1
wheel 0.34.2
xdg 5
xkit 0.0.0


**Output of the virtual environment creation**

Make sure to run the creation with `-vvv --with-traceback`:

```console
55 setup logging to NOTSET [DEBUG report:43]
100 find interpreter for spec PythonSpec(implementation=CPython, major=3, minor=8) [INFO builtin:62]
100 proposed PythonInfo(spec=CPython3.9.5.final.0-64, exe=/usr/bin/python3, platform=linux, version='3.9.5 (default, May 11 2021, 08:20:37) \n[GCC 10.3.0]', encoding_fs_io=utf-8-utf-8) [INFO builtin:69]
100 discover PATH[0]=/home/X/.cargo/bin [DEBUG builtin:114]
100 filesystem is case-sensitive [DEBUG info:29]
100 discover PATH[1]=/home/X/.local/bin [DEBUG builtin:114]
100 discover PATH[2]=/usr/local/sbin [DEBUG builtin:114]
100 discover PATH[3]=/usr/local/bin [DEBUG builtin:114]
101 discover PATH[4]=/usr/sbin [DEBUG builtin:114]
101 discover PATH[5]=/usr/bin [DEBUG builtin:114]
101 Attempting to acquire lock 139915314565952 on /home/X/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.lock [DEBUG _api:154]
101 Lock 139915314565952 acquired on /home/X/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.lock [DEBUG _api:158]
101 got python info of /usr/bin/python3.8 from /home/X/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.json [DEBUG via_disk_folder:135]
102 Attempting to release lock 139915314565952 on /home/X/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.lock [DEBUG _api:188]
102 Lock 139915314565952 released on /home/X/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.lock [DEBUG _api:191]
102 proposed PathPythonInfo(spec=CPython3.8.10.final.0-64, exe=/usr/bin/python3.8, platform=linux, version='3.8.10 (default, Jun  2 2021, 10:49:15) \n[GCC 10.3.0]', encoding_fs_io=utf-8-utf-8) [INFO builtin:69]
102 accepted PathPythonInfo(spec=CPython3.8.10.final.0-64, exe=/usr/bin/python3.8, platform=linux, version='3.8.10 (default, Jun  2 2021, 10:49:15) \n[GCC 10.3.0]', encoding_fs_io=utf-8-utf-8) [DEBUG builtin:71]
125 create virtual environment via CPython3Posix(dest=/home/X/Y/venv, clear=False, no_vcs_ignore=False, global=False) [INFO session:52]
125 write /home/X/Y/venv/pyvenv.cfg [DEBUG pyenv_cfg:34]
125 	home = /usr [DEBUG pyenv_cfg:38]
125 	implementation = CPython [DEBUG pyenv_cfg:38]
125 	version_info = 3.8.10.final.0 [DEBUG pyenv_cfg:38]
125 	virtualenv = 20.8.1 [DEBUG pyenv_cfg:38]
125 	include-system-site-packages = false [DEBUG pyenv_cfg:38]
125 	base-prefix = /usr [DEBUG pyenv_cfg:38]
125 	base-exec-prefix = /usr [DEBUG pyenv_cfg:38]
125 	base-executable = /usr/bin/python3.8 [DEBUG pyenv_cfg:38]
125 remove file /home/X/Y/venv/bin/python [DEBUG _sync:38]
125 symlink /usr/bin/python3.8 to /home/X/Y/venv/bin/python [DEBUG _sync:44]
126 create virtualenv import hook file /home/X/Y/venv/lib/python3.8/site-packages/_virtualenv.pth [DEBUG api:95]
126 create /home/X/Y/venv/lib/python3.8/site-packages/_virtualenv.py [DEBUG api:98]
126 ============================== target debug ============================== [DEBUG session:54]
126 debug via /home/X/Y/venv/bin/python /home/X/.local/lib/python3.9/site-packages/virtualenv/create/debug.py [DEBUG creator:224]
126 {
"sys": {
  "executable": "/home/X/Y/venv/bin/python",
  "_base_executable": "/home/X/Y/venv/bin/python",
  "prefix": "/home/X/Y/venv",
  "base_prefix": "/usr",
  "real_prefix": null,
  "exec_prefix": "/home/X/Y/venv",
  "base_exec_prefix": "/usr",
  "path": [
    "/usr/lib/python38.zip",
    "/usr/lib/python3.8",
    "/usr/lib/python3.8/lib-dynload",
    "/home/X/Y/venv/lib/python3.8/site-packages"
  ],
  "meta_path": [
    "<class '_virtualenv._Finder'>",
    "<class '_frozen_importlib.BuiltinImporter'>",
    "<class '_frozen_importlib.FrozenImporter'>",
    "<class '_frozen_importlib_external.PathFinder'>"
  ],
  "fs_encoding": "utf-8",
  "io_encoding": "utf-8"
},
"version": "3.8.10 (default, Jun  2 2021, 10:49:15) \n[GCC 10.3.0]",
"makefile_filename": "/usr/lib/python3.8/config-3.8-x86_64-linux-gnu/Makefile",
"os": "<module 'os' from '/usr/lib/python3.8/os.py'>",
"site": "<module 'site' from '/usr/lib/python3.8/site.py'>",
"datetime": "<module 'datetime' from '/usr/lib/python3.8/datetime.py'>",
"math": "<module 'math' (built-in)>",
"json": "<module 'json' from '/usr/lib/python3.8/json/__init__.py'>"
} [DEBUG session:55]
148 add seed packages via FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/X/.local/share/virtualenv) [INFO session:59]
150 got embed update of distribution pip from /home/X/.local/share/virtualenv/wheel/3.8/embed/1/pip.json [DEBUG via_disk_folder:135]
152 got embed update of distribution setuptools from /home/X/.local/share/virtualenv/wheel/3.8/embed/1/setuptools.json [DEBUG via_disk_folder:135]
153 got embed update of distribution wheel from /home/X/.local/share/virtualenv/wheel/3.8/embed/1/wheel.json [DEBUG via_disk_folder:135]
153 got embed update of distribution pip from /home/X/.local/share/virtualenv/wheel/3.8/embed/1/pip.json [DEBUG via_disk_folder:135]
153 got embed update of distribution setuptools from /home/X/.local/share/virtualenv/wheel/3.8/embed/1/setuptools.json [DEBUG via_disk_folder:135]
154 got embed update of distribution wheel from /home/X/.local/share/virtualenv/wheel/3.8/embed/1/wheel.json [DEBUG via_disk_folder:135]
154 install pip from wheel /home/X/.local/lib/python3.9/site-packages/virtualenv/seed/wheels/embed/pip-21.2.4-py3-none-any.whl via CopyPipInstall [DEBUG via_app_data:49]
154 install setuptools from wheel /home/X/.local/lib/python3.9/site-packages/virtualenv/seed/wheels/embed/setuptools-58.1.0-py3-none-any.whl via CopyPipInstall [DEBUG via_app_data:49]
154 install wheel from wheel /home/X/.local/lib/python3.9/site-packages/virtualenv/seed/wheels/embed/wheel-0.37.0-py2.py3-none-any.whl via CopyPipInstall [DEBUG via_app_data:49]
155 Attempting to acquire lock 139915286545120 on /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-58.1.0-py3-none-any.lock [DEBUG _api:154]
155 Attempting to acquire lock 139915286545792 on /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.37.0-py2.py3-none-any.lock [DEBUG _api:154]
155 Attempting to acquire lock 139915286546032 on /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-21.2.4-py3-none-any.lock [DEBUG _api:154]
155 Lock 139915286545120 acquired on /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-58.1.0-py3-none-any.lock [DEBUG _api:158]
155 Lock 139915286545792 acquired on /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.37.0-py2.py3-none-any.lock [DEBUG _api:158]
155 Lock 139915286546032 acquired on /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-21.2.4-py3-none-any.lock [DEBUG _api:158]
155 Attempting to release lock 139915286545120 on /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-58.1.0-py3-none-any.lock [DEBUG _api:188]
155 Lock 139915286545120 released on /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-58.1.0-py3-none-any.lock [DEBUG _api:191]
155 Attempting to release lock 139915286545792 on /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.37.0-py2.py3-none-any.lock [DEBUG _api:188]
155 Attempting to release lock 139915286546032 on /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-21.2.4-py3-none-any.lock [DEBUG _api:188]
155 Lock 139915286545792 released on /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.37.0-py2.py3-none-any.lock [DEBUG _api:191]
155 Lock 139915286546032 released on /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-21.2.4-py3-none-any.lock [DEBUG _api:191]
156 uninstall existing distribution setuptools-58.1.0 from /home/X/Y/venv/lib/python3.8/site-packages [DEBUG base:161]
156 uninstall existing distribution wheel-0.37.0 from /home/X/Y/venv/lib/python3.8/site-packages [DEBUG base:161]
156 uninstall existing distribution pip-21.2.4 from /home/X/Y/venv/lib/python3.8/site-packages [DEBUG base:161]
172 copy /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.37.0-py2.py3-none-any/wheel-0.37.0.virtualenv to /home/X/Y/venv/lib/python3.8/site-packages/wheel-0.37.0.virtualenv [DEBUG _sync:52]
173 copy directory /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.37.0-py2.py3-none-any/wheel-0.37.0.dist-info to /home/X/Y/venv/lib/python3.8/site-packages/wheel-0.37.0.dist-info [DEBUG _sync:52]
174 copy directory /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.37.0-py2.py3-none-any/wheel to /home/X/Y/venv/lib/python3.8/site-packages/wheel [DEBUG _sync:52]
178 copy /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-58.1.0-py3-none-any/setuptools-58.1.0.virtualenv to /home/X/Y/venv/lib/python3.8/site-packages/setuptools-58.1.0.virtualenv [DEBUG _sync:52]
179 copy directory /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-58.1.0-py3-none-any/setuptools-58.1.0.dist-info to /home/X/Y/venv/lib/python3.8/site-packages/setuptools-58.1.0.dist-info [DEBUG _sync:52]
179 generated console scripts wheel3.8 wheel3 wheel-3.8 wheel [DEBUG base:45]
180 copy directory /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-58.1.0-py3-none-any/setuptools to /home/X/Y/venv/lib/python3.8/site-packages/setuptools [DEBUG _sync:52]
186 copy /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-21.2.4-py3-none-any/pip-21.2.4.virtualenv to /home/X/Y/venv/lib/python3.8/site-packages/pip-21.2.4.virtualenv [DEBUG _sync:52]
186 copy directory /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-21.2.4-py3-none-any/pip-21.2.4.dist-info to /home/X/Y/venv/lib/python3.8/site-packages/pip-21.2.4.dist-info [DEBUG _sync:52]
187 copy directory /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-21.2.4-py3-none-any/pip to /home/X/Y/venv/lib/python3.8/site-packages/pip [DEBUG _sync:52]
197 copy directory /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-58.1.0-py3-none-any/pkg_resources to /home/X/Y/venv/lib/python3.8/site-packages/pkg_resources [DEBUG _sync:52]
201 copy directory /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-58.1.0-py3-none-any/_distutils_hack to /home/X/Y/venv/lib/python3.8/site-packages/_distutils_hack [DEBUG _sync:52]
202 copy /home/X/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-58.1.0-py3-none-any/distutils-precedence.pth to /home/X/Y/venv/lib/python3.8/site-packages/distutils-precedence.pth [DEBUG _sync:52]
202 generated console scripts  [DEBUG base:45]
225 generated console scripts pip3 pip3.8 pip-3.8 pip [DEBUG base:45]
225 add activators for Bash, CShell, Fish, Nushell, PowerShell, Python [INFO session:64]
227 write /home/X/Y/venv/pyvenv.cfg [DEBUG pyenv_cfg:34]
227 	home = /usr [DEBUG pyenv_cfg:38]
227 	implementation = CPython [DEBUG pyenv_cfg:38]
227 	version_info = 3.8.10.final.0 [DEBUG pyenv_cfg:38]
227 	virtualenv = 20.8.1 [DEBUG pyenv_cfg:38]
227 	include-system-site-packages = false [DEBUG pyenv_cfg:38]
227 	base-prefix = /usr [DEBUG pyenv_cfg:38]
227 	base-exec-prefix = /usr [DEBUG pyenv_cfg:38]
227 	base-executable = /usr/bin/python3.8 [DEBUG pyenv_cfg:38]
227 created virtual environment CPython3.8.10.final.0-64 in 173ms
creator CPython3Posix(dest=/home/X/Y/venv, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/X/.local/share/virtualenv)
  added seed packages: pip==21.2.4, setuptools==58.1.0, wheel==0.37.0
activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator [WARNING __main__:19]
@Yuri6037 Yuri6037 added the bug label Oct 5, 2021
@gaborbernat
Copy link
Contributor

Did you install virtualenv via apt-get?

@Yuri6037
Copy link
Author

Yuri6037 commented Oct 5, 2021

No I installed virtualenv by pip3 install virtualenv

@Ohior
Copy link

Ohior commented Aug 7, 2022

Try installing using pip install virtualenv instead of pip3 install virtualenv
and create a virtual environment using virtualenv myvenv -p python3.9 make sure you specify the python version
then you can activate the environment like this.
For CMD use myvenv\\scripts\\activate or for bash use source myvenv\\scripts\\activate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants