#๐ Error Occured while trying install a package in virtualenv.
57 messages ยท Page 1 of 1 (latest)
@cunning reef
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
My Path says:
export PATH=/Library/Frameworks/Python.framework/Versions/3.13/bin:$PATH
When i follow through and actually look at where the PATH ends up, here is what I get:
Inheritanc-e Frameworks %:ls
CoreRepairCore.framework CoreRepairKit.framework Python.framework iTunesLibrary.framework
Inheritanc-e Frameworks %:cd Python.framework
Inheritanc-e Python.framework %:ls
Headers Python Resources Versions
Inheritanc-e Python.framework %:cd Versions
Inheritanc-e Versions %:ls
3.10 3.12 3.13 3.8 3.9 Current
Inheritanc-e Versions %:cd ..
Inheritanc-e Python.framework %:cd Python
cd: not a directory: Python
Inheritanc-e Python.framework %:ls
Headers Python Resources Versions
Inheritanc-e Python.framework %:cd Versions
Inheritanc-e Versions %:lw
zsh: command not found: lw
Inheritanc-e Versions %:ls
3.10 3.12 3.13 3.8 3.9 Current
Inheritanc-e Versions %:
I also got another error here,
โ Successfully created virtual environment!
Failed to load paths: Traceback (most recent call last):
File "<string>", line 1, in <module>
import sysconfig, distutils.sysconfig, io, json, sys; paths = {u'purelib': u'{0}'.format(distutils.sysconfig.get_python_lib(plat_specific=0)),u'stdlib': u'{0}'.format(sysconfig.get_path('stdlib')),u'platlib': u'{0}'.format(distutils.sysconfig.get_python_lib(plat_specific=1)),u'platstdlib': u'{0}'.format(sysconfig.get_path('platstdlib')),u'include': u'{0}'.format(distutils.sysconfig.get_python_inc(plat_specific=0)),u'platinclude': u'{0}'.format(distutils.sysconfig.get_python_inc(plat_specific=1)),u'scripts': u'{0}'.format(sysconfig.get_path('scripts')),u'py_version_short': u'{0}'.format(distutils.sysconfig.get_python_version()), }; value = u'{0}'.format(json.dumps(paths));fh = io.open('/var/folders/d8/7dcs21954fv5y4fc9dt96k_w0000gn/T/tmpbba_ev57.json', 'w'); fh.write(value); fh.close()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'distutils'
i can't say exactly what's going on, but i know distutils was removed from the standard library in 3.12+
usage of distutils.sysconfig was apparently removed since pipenv's 2022.8.5 release
but judging from your earlier traceback i assume you have the latest version already, 2024.2.0
ye pretty sure, and now because of "no module named distutils" pipenv isn't actually installing other modules as well
Error: An error occurred while installing pyside6!
Error text:
Traceback (most recent call last):
File "/Users/inheritanc-e/.local/share/virtualenvs/qt6-GxBq9NXW/bin/pip", line 5, in <module>
from pip._internal.cli.main import main
File "/Users/inheritanc-e/.local/share/virtualenvs/qt6-GxBq9NXW/lib/python3.13/site-packages/pip/_internal/cli/main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/Users/inheritanc-e/.local/share/virtualenvs/qt6-GxBq9NXW/lib/python3.13/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/Users/inheritanc-e/.local/share/virtualenvs/qt6-GxBq9NXW/lib/python3.13/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "/Users/inheritanc-e/.local/share/virtualenvs/qt6-GxBq9NXW/lib/python3.13/site-packages/pip/_internal/cli/cmdoptions.py", line 18, in <module>
from distutils.util import strtobool
ModuleNotFoundError: No module named 'distutils'
โ Installation Failed
in that case, pip is probably out of date
Inheritanc-e qt6 %:python3 -m pip --version
pip 24.2 from /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/pip (python 3.13)
i don't think it is
the latest version of pip i could find where the statement from distutils.util import strtobool exists is 20.3.4
https://github.com/pypa/pip/blob/20.3.4/src/pip/_internal/cli/cmdoptions.py#L18
that line was then subsequently removed in pip 21.0
src/pip/_internal/cli/cmdoptions.py line 18
from distutils.util import strtobool```
that's your global pip installation, not necessarily the same one being used in the virtualenv
(qt6) Inheritanc-e qt6 %:pipenv run python3 -m pip --version
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/Users/inheritanc-e/.local/share/virtualenvs/qt6-GxBq9NXW/lib/python3.13/site-packages/pip/__main__.py", line 23, in <module>
from pip._internal.cli.main import main as _main # isort:skip # noqa
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/inheritanc-e/.local/share/virtualenvs/qt6-GxBq9NXW/lib/python3.13/site-packages/pip/_internal/cli/main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/Users/inheritanc-e/.local/share/virtualenvs/qt6-GxBq9NXW/lib/python3.13/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/Users/inheritanc-e/.local/share/virtualenvs/qt6-GxBq9NXW/lib/python3.13/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "/Users/inheritanc-e/.local/share/virtualenvs/qt6-GxBq9NXW/lib/python3.13/site-packages/pip/_internal/cli/cmdoptions.py", line 18, in <module>
from distutils.util import strtobool
ModuleNotFoundError: No module named 'distutils'
this is what I got while trying to check the pip in the venv
how does pipenv normally upgrade pip?
wdym?
when i use the virtualenv tool, it has a --upgrade-embed-wheels option that updates the default packages included in new virtual environments i create, i.e. pip, setuptools, and sometimes wheel
does pipenv have something similar? the errors would suggest the version of pip included in their virtual environments is <21.0
my venv also has that
should I use it?
hmm, is it possible for you to use ensurepip to upgrade it? as in: sh pipenv run python3 -m ensurepip --upgrade
pipenv also has an --upgrade-embed-wheels option? or do you mean something else?
I don't think pipenv will run any command at all, cause of distills
virtualenv
wait, your venv has virtualenv installed inside it?
no i meant my global venv
ah okay
I did run this,
Inheritanc-e qt6 %:pipenv run python3 -m ensurepip --upgrade
Looking in links: /var/folders/d8/7dcs21954fv5y4fc9dt96k_w0000gn/T/tmpgl1_qznb
Requirement already satisfied: pip in /Users/inheritanc-e/.local/share/virtualenvs/qt6-GxBq9NXW/lib/python3.13/site-packages (20.2.4)
Processing /var/folders/d8/7dcs21954fv5y4fc9dt96k_w0000gn/T/tmpgl1_qznb/pip-24.2-py3-none-any.whl
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.2.4
Uninstalling pip-20.2.4:
Successfully uninstalled pip-20.2.4
Successfully installed pip-24.2
aight
--upgrade-embed-wheels might actually help with future virtual environments, if pipenv is in the same global venv
oh right, pipenv is still invoking distutils...
does pipenv have a command to check its own version?
ye
i'd assume pipenv -V or pipenv --version, but their docs don't show what options are available
oh ye that's way out of date
^
the first release of 3.12, when distutils was removed from stdlib, was in october of 2023
lol, i haven't used python in a while that's why
leme upgrade pipenv
Installing collected packages: pipenv
Successfully installed pipenv-2024.2.0
as well, distutils was first deprecated by PEP 632 when python 3.10 released in 2021, so pipenv couldn't have predicted its removal back in 2020
I see. Now it's just the pipfile locking process which is taking a while.
Thanks for the help btw @rustic totem. you mind if i keep this open till the process is completely done?
no worries
Installing dependencies from Pipfile.lock (97e60a)...
All dependencies are now up-to-date!
Installing dependencies from Pipfile.lock (97e60a)...
(qt6) Inheritanc-e qt6 %:
Thanks man
!close
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.