Open marekdedic opened 1 year ago
@marekdedic I am not sure as I have not seen this issue before, but noting you are on 2022.12.19
-- could you try upgrading to 2023.4.29
and see if the issue persists?
Nope, the issue is still the same even with that version of pipenv. In the meantime, I somehow got it to work once (had to install libsnappy-dev
along the way), but I cannot recreate it again :(
Is it possible you have an old version of pipenv somewhere on the path and its getting confused when running the subprocesses?
Also would be worth having you try the new release of pipenv that was just cut, but make sure you pip uninstall pipenv --yes
multiple times until it is clearly not on the path anymore, just in case.
same issue here:
What version of setuptools do you have installed?
System python:
>>> setuptools.__version__
'67.7.2'
pipenv shell:
>>> setuptools.__version__
'66.1.1'
Could this be rechecked with 2023.6.12
-- I have a hunch that the sys.path hacks I removed could have been causing this as well.
Still the same with 2023.6.18
:(
Same
I had a similar issue with v2023.6.18
and v2023.6.12
both failing while v2023.6.11
worked. It may be unrelated to your issue but I eventually tracked it down to another pipenv install in my environment. The removal of the sys.path
manipulation in 1cc03eaa3b13114fca0d84fcad25148f71f413ff exposes pipenv to issues with module resolution confusion.
I'm suspecting that pipenv
is importing a module from a different install which is resulting in the downstream errors - this snippet in particular
[pipenv.exceptions.InstallError]: File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
[pipenv.exceptions.InstallError]: exec(code, run_globals)
[pipenv.exceptions.InstallError]: File "/usr/lib/python3/dist-packages/pipenv/patched/pip/__main__.py", line 35, in <module>
[pipenv.exceptions.InstallError]: spec.loader.exec_module(pipenv)
there looks like there could be 2 different venvs involved
/usr/lib/python3.9
and
/usr/lib/python3
In my case, I had a global pipenv
install in my python 3.11
and another install in python 3.7
- running pipenv
from a python 3.7
venv was using the install from the python 3.11
but resolving internal pipenv modules from the python 3.7
install
Umm, @matteius why was this closed without any comment or resolution?
@marekdedic Are you saying this is still an issue for you on 2023.9.1
?
@matteius Yes, I do:
$ pipenv install
Installing dependencies from Pipfile.lock (2f3ef0)...
[pipenv.exceptions.InstallError]: Traceback (most recent call last):
[pipenv.exceptions.InstallError]: File "/home/user/.local/lib/python3.11/site-packages/pipenv/patched/pip/__pip-runner__.py", line 50, in <module>
[pipenv.exceptions.InstallError]: runpy.run_module("pip", run_name="__main__", alter_sys=True)
[pipenv.exceptions.InstallError]: File "/usr/lib/python3.9/runpy.py", line 225, in run_module
[pipenv.exceptions.InstallError]: return _run_module_code(code, init_globals, run_name, mod_spec)
[pipenv.exceptions.InstallError]: File "/usr/lib/python3.9/runpy.py", line 97, in _run_module_code
[pipenv.exceptions.InstallError]: _run_code(code, mod_globals, init_globals,
[pipenv.exceptions.InstallError]: File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
[pipenv.exceptions.InstallError]: exec(code, run_globals)
[pipenv.exceptions.InstallError]: File "/home/user/.local/lib/python3.11/site-packages/pipenv/patched/pip/__main__.py", line 28, in <module>
[pipenv.exceptions.InstallError]: spec.loader.exec_module(pipenv)
[pipenv.exceptions.InstallError]: File "<frozen importlib._bootstrap_external>", line 850, in exec_module
[pipenv.exceptions.InstallError]: File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
[pipenv.exceptions.InstallError]: File "/home/user/.local/lib/python3.11/site-packages/pipenv/__init__.py", line 40, in <module>
[pipenv.exceptions.InstallError]: from pipenv.cli import cli # noqa
[pipenv.exceptions.InstallError]: File "/home/user/.local/lib/python3.11/site-packages/pipenv/cli/__init__.py", line 1, in <module>
[pipenv.exceptions.InstallError]: from .command import cli # noqa
[pipenv.exceptions.InstallError]: File "/home/user/.local/lib/python3.11/site-packages/pipenv/cli/command.py", line 4, in <module>
[pipenv.exceptions.InstallError]: from pipenv import environments
[pipenv.exceptions.InstallError]: File "/home/user/.local/lib/python3.11/site-packages/pipenv/environments.py", line 8, in <module>
[pipenv.exceptions.InstallError]: from pipenv.utils.fileutils import normalize_drive
[pipenv.exceptions.InstallError]: File "/home/user/.local/lib/python3.11/site-packages/pipenv/utils/fileutils.py", line 15, in <module>
[pipenv.exceptions.InstallError]: from pipenv.patched.pip._internal.locations import USER_CACHE_DIR
[pipenv.exceptions.InstallError]: File "/home/user/.local/lib/python3.11/site-packages/pipenv/patched/pip/_internal/locations/__init__.py", line 66, in <module>
[pipenv.exceptions.InstallError]: from . import _distutils
[pipenv.exceptions.InstallError]: File "/home/user/.local/lib/python3.11/site-packages/pipenv/patched/pip/_internal/locations/_distutils.py", line 20, in <module>
[pipenv.exceptions.InstallError]: from distutils.cmd import Command as DistutilsCommand
[pipenv.exceptions.InstallError]: ModuleNotFoundError: No module named 'distutils.cmd'
ERROR: Couldn't install package: {}
Package installation failed...
/usr/lib/python3.11/subprocess.py:1127: ResourceWarning: subprocess 153315 is still running
_warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=4 encoding='utf-8'>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=7 encoding='utf-8'>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
$ pipenv --version
pipenv, version 2023.9.8
@marekdedic Can you try setting env var _PIP_USE_SYSCONFIG = false
-- I am not sure why this is happening for you, I haven't see this issue and had assumed what Travis was saying about a prior patch that we added back to ensure latest installed pipenv is in the sys path.
Doesn't help :(
$ export _PIP_USE_SYSCONFIG=false
$ pipenv install
Installing dependencies from Pipfile.lock (2f3ef0)...
[pipenv.exceptions.InstallError]: Traceback (most recent call last):
[pipenv.exceptions.InstallError]: File "/home/user/.local/lib/python3.11/site-packages/pipenv/patched/pip/__pip-runner__.py", line 50, in <module>
[pipenv.exceptions.InstallError]: runpy.run_module("pip", run_name="__main__", alter_sys=True)
[pipenv.exceptions.InstallError]: File "/usr/lib/python3.9/runpy.py", line 225, in run_module
[pipenv.exceptions.InstallError]: return _run_module_code(code, init_globals, run_name, mod_spec)
[pipenv.exceptions.InstallError]: File "/usr/lib/python3.9/runpy.py", line 97, in _run_module_code
[pipenv.exceptions.InstallError]: _run_code(code, mod_globals, init_globals,
[pipenv.exceptions.InstallError]: File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
[pipenv.exceptions.InstallError]: exec(code, run_globals)
[pipenv.exceptions.InstallError]: File "/home/user/.local/lib/python3.11/site-packages/pipenv/patched/pip/__main__.py", line 28, in <module>
[pipenv.exceptions.InstallError]: spec.loader.exec_module(pipenv)
[pipenv.exceptions.InstallError]: File "<frozen importlib._bootstrap_external>", line 850, in exec_module
[pipenv.exceptions.InstallError]: File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
[pipenv.exceptions.InstallError]: File "/home/user/.local/lib/python3.11/site-packages/pipenv/__init__.py", line 40, in <module>
[pipenv.exceptions.InstallError]: from pipenv.cli import cli # noqa
[pipenv.exceptions.InstallError]: File "/home/user/.local/lib/python3.11/site-packages/pipenv/cli/__init__.py", line 1, in <module>
[pipenv.exceptions.InstallError]: from .command import cli # noqa
[pipenv.exceptions.InstallError]: File "/home/user/.local/lib/python3.11/site-packages/pipenv/cli/command.py", line 4, in <module>
[pipenv.exceptions.InstallError]: from pipenv import environments
[pipenv.exceptions.InstallError]: File "/home/user/.local/lib/python3.11/site-packages/pipenv/environments.py", line 8, in <module>
[pipenv.exceptions.InstallError]: from pipenv.utils.fileutils import normalize_drive
[pipenv.exceptions.InstallError]: File "/home/user/.local/lib/python3.11/site-packages/pipenv/utils/fileutils.py", line 15, in <module>
[pipenv.exceptions.InstallError]: from pipenv.patched.pip._internal.locations import USER_CACHE_DIR
[pipenv.exceptions.InstallError]: File "/home/user/.local/lib/python3.11/site-packages/pipenv/patched/pip/_internal/locations/__init__.py", line 66, in <module>
[pipenv.exceptions.InstallError]: from . import _distutils
[pipenv.exceptions.InstallError]: File "/home/user/.local/lib/python3.11/site-packages/pipenv/patched/pip/_internal/locations/_distutils.py", line 20, in <module>
[pipenv.exceptions.InstallError]: from distutils.cmd import Command as DistutilsCommand
[pipenv.exceptions.InstallError]: ModuleNotFoundError: No module named 'distutils.cmd'
ERROR: Couldn't install package: {}
Package installation failed...
/usr/lib/python3.11/subprocess.py:1127: ResourceWarning: subprocess 311396 is still running
_warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=4 encoding='utf-8'>
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=7 encoding='utf-8'>
Having exactly the same issue, can someone help with this?
I had 3.11 as my version where pipenv was installed, and 3.12 for my virtual environment for the project
I could fix it with:
pip install setuptools
executed within the 3.12 shell
Hi, while running
pipenv install
, I get a long list of errors, but I think the most important one is the following few lines:I have searched for the common causes of this and I can say the following:
python3-distutils
andpython3-apt
installed, I also tried reinstalling themdistutils
module from my system python:distutils
module frompipenv shell
:So.. What gives? The module is obviously there, but somehow pipenv cannot find it
Please run
$ pipenv --support
, and paste the results here. Don't put backticks (`
) around it! The output already contains Markdown formatting.If you're on Linux, run the following:
$ pipenv --support
Pipenv version: `'2022.12.19'` Pipenv location: `'/usr/lib/python3/dist-packages/pipenv'` Python location: `'/usr/bin/python3'` OS Name: `'posix'` User pip version: `'22.3.1'` user Python installations found: - `3.11.2`: `/usr/bin/python3` - `3.11.2`: `/bin/python3` - `3.9.13`: `/usr/bin/python3.9` - `3.9.13`: `/bin/python3.9` - `3.8.5`: `/opt/miniconda3/bin/python3` - `3.8.5`: `/opt/miniconda3/bin/python3.8` - `3.8.5`: `/opt/miniconda3/bin/python` - `2.7.18`: `/usr/bin/python2` - `2.7.18`: `/usr/bin/python2.7` - `2.7.18`: `/bin/python2` - `2.7.18`: `/bin/python2.7` PEP 508 Information: ``` {'implementation_name': 'cpython', 'implementation_version': '3.11.2', 'os_name': 'posix', 'platform_machine': 'x86_64', 'platform_python_implementation': 'CPython', 'platform_release': '6.1.0-7-amd64', 'platform_system': 'Linux', 'platform_version': '#1 SMP PREEMPT_DYNAMIC Debian 6.1.20-2 (2023-04-08)', 'python_full_version': '3.11.2', 'python_version': '3.11', 'sys_platform': 'linux'} ``` System environment variables: - `ALACRITTY_LOG` - `ALACRITTY_SOCKET` - `ALACRITTY_WINDOW_ID` - `ANDROID_HOME` - `COLORTERM` - `CONDA_DEFAULT_ENV` - `CONDA_EXE` - `CONDA_PREFIX` - `CONDA_PROMPT_MODIFIER` - `CONDA_PYTHON_EXE` - `CONDA_SHLVL` - `DBUS_SESSION_BUS_ADDRESS` - `DESKTOP_SESSION` - `DISPLAY` - `EDITOR` - `GDMSESSION` - `GDM_LANG` - `GIO_LAUNCHED_DESKTOP_FILE` - `GIO_LAUNCHED_DESKTOP_FILE_PID` - `GJS_DEBUG_OUTPUT` - `GJS_DEBUG_TOPICS` - `GNOME_DESKTOP_SESSION_ID` - `GNOME_SETUP_DISPLAY` - `GTK_MODULES` - `HOME` - `INVOCATION_ID` - `JOURNAL_STREAM` - `JULIA_NUM_THREADS` - `LANG` - `LANGUAGE` - `LC_MEASUREMENT` - `LC_MONETARY` - `LC_NUMERIC` - `LC_PAPER` - `LC_TIME` - `LESS` - `LOGNAME` - `LSCOLORS` - `LS_COLORS` - `MANAGERPID` - `MOZ_ENABLE_WAYLAND` - `OLDPWD` - `P9K_TTY` - `PAGER` - `PATH` - `POWERLINE_COMMAND` - `PWD` - `QTWEBENGINE_DICTIONARIES_PATH` - `QT_ACCESSIBILITY` - `QT_IM_MODULE` - `SESSION_MANAGER` - `SHELL` - `SHLVL` - `SKIM_CTRL_T_COMMAND` - `SKIM_DEFAULT_COMMAND` - `SSH_AGENT_LAUNCHER` - `SSH_AUTH_SOCK` - `SYSTEMD_EXEC_PID` - `TERM` - `TERM_PROGRAM` - `TERM_PROGRAM_VERSION` - `TMUX` - `TMUX_PANE` - `TMUX_PLUGIN_MANAGER_PATH` - `USER` - `USERNAME` - `VISUAL` - `WAYLAND_DISPLAY` - `WINDOWID` - `XAUTHORITY` - `XDG_CURRENT_DESKTOP` - `XDG_MENU_PREFIX` - `XDG_RUNTIME_DIR` - `XDG_SESSION_CLASS` - `XDG_SESSION_DESKTOP` - `XDG_SESSION_TYPE` - `XMODIFIERS` - `ZSH` - `_` - `_CE_CONDA` - `_CE_M` - `_P9K_SSH_TTY` - `_P9K_TTY` - `is_vim` - `P9K_SSH` - `PIP_DISABLE_PIP_VERSION_CHECK` - `PIP_PYTHON_PATH` - `PYTHONDONTWRITEBYTECODE` - `PYTHONFINDER_IGNORE_UNSUPPORTED` Pipenv–specific environment variables: Debug–specific environment variables: - `PATH`: `/home/user/.local/bin:/opt/miniconda3/bin:/opt/miniconda3/condabin:/home/user/.local/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin` - `SHELL`: `/bin/zsh` - `EDITOR`: `nvim` - `LANG`: `en_US.UTF-8` - `PWD`: `/home/user/project` --------------------------- Contents of `Pipfile` ('/home/user/project/Pipfile'): ```toml [[source]] name = "pypi" url = "https://pypi.org/simple" verify_ssl = true [[source]] name = "redacted" url = "redacted" verify_ssl = true [dev-packages] notebook = "== 6.4.12" jupyterhub = "== 1.5.0" jupyterlab = "== 3.3.2" dask-labextension = "== 5.2.0" bokeh = "== 2.4.3" ipywidgets = "== 7.7.0" # Research matplotlib = "*" scikit-learn = "*" scipy = "*" cryptography = ">=38.0.3" [packages] ## DASK kubernetes = "== 17.17.0" dask = { extras = ["complete", "dataframe"], version = "== 2022.09.2" } dask-kubernetes = "== 2022.9.0" distributed = "== 2022.09.2" click = "== 8.0.2" # Research aiohttp = ">=3.7.4" fastparquet = "*" python-snappy = "*" pandas = "1.5.0" pyarrow = "*" pyathena = "*" pytest = "*" pytest-cov = "*" pytest-mock = "*" s3fs = "*" smart_open = "*" numpy = "*" hypothesis = "*" threatqsdk = { version = "*", index = "cognitive-intelligence" } vt-py = "==0.17.3" tldextract = "*" aiofiles = "*" pytest-asyncio = "*" [requires] python_version = "3.9" #TODO: doens't work with jupyterhub [pipenv] allow_prereleases = false ``` Contents of `Pipfile.lock` ('/home/user/project/Pipfile.lock'): ```json { "_meta": { "hash": { "sha256": "d743e6571b658ebc0baf48d5cc01fe2170bd3f490330ab917bec86b7c763e859" }, "pipfile-spec": 6, "requires": { "python_version": "3.9" }, "sources": [ { "name": "pypi", "url": "https://pypi.org/simple", "verify_ssl": true }, { "name": "redacted", "url": "redacted", "verify_ssl": true } ] }, "default": { } } ```