You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have pyenv with python 3.11.9 installed. This "default" installation has setuptools==74.1.2 and I used it to create a virtual environment via pipenv.
Now inside this virtual environment (with pipenv shell), I'm trying to install an older version of a package. There is no binary available, so pip tries to build it from source. This particular version of the package needs setuptools==68.0.0, so I installed it in the virtual environment. The problem is my PYTHONPATH ordering seems to be prioritizing the lib from the "default" installation instead of the lib from the virtual environment, so the build fails.
I think the last entry there should be at the top to fix this issue.
I believe pip is using setuptools==74.1.2 to build (and failed) because the build process looks for setuptools.msvc.msvc14_get_vc_env which was presented in setuptools==68.0.0, but not in 74.1.2.
Expected result
pip build should be able to find setuptools==68.0.0
PYTHONPATH should prioritize lib from virtual environment, not the other way around.
Actual result
AttributeError: module 'setuptools.msvc' has no attribute 'msvc14_get_vc_env'
Traceback (most recent call last):
File "C:\Users\redacted-user\.virtualenvs\redacted-hashdVal\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in
main()
File "C:\Users\redacted-user\.virtualenvs\redacted-hashdVal\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\redacted-user\.virtualenvs\redacted-hashdVal\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\build_meta.py", line 332, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\build_meta.py", line 302, in _get_build_requires
self.run_setup()
File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\build_meta.py", line 318, in run_setup
exec(code, locals())
File "", line 1375, in
File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\__init__.py", line 117, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 184, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 200, in run_commands
dist.run_commands()
File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 954, in run_commands
self.run_command(cmd)
File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\dist.py", line 950, in run_command
super().run_command(command)
File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_command
cmd_obj.run()
File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 311, in run
self.find_sources()
File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 319, in find_sources
mm.run()
File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 540, in run
self.add_defaults()
File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 578, in add_defaults
sdist.add_defaults(self)
File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\command\sdist.py", line 108, in add_defaults
super().add_defaults()
File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 250, in add_defaults
self._add_defaults_ext()
File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 334, in _add_defaults_ext
build_ext = self.get_finalized_command('build_ext')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 303, in get_finalized_command
cmd_obj.ensure_finalized()
File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 111, in ensure_finalized
self.finalize_options()
File "", line 1112, in finalize_options
File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\dist.py", line 950, in run_command
super().run_command(command)
File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 972, in run_command
cmd_obj.ensure_finalized()
File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 111, in ensure_finalized
self.finalize_options()
File "", line 359, in finalize_options
File "C:\Users\redacted-user\AppData\Local\Temp\pip-install-n00bj9jo\pyzmq_f14305d6a30a4a9aa78fa956e48cfef5\buildutils\misc.py", line 71, in locate_vcredist_dir
vcvars = msvc.msvc14_get_vc_env(plat)
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'setuptools.msvc' has no attribute 'msvc14_get_vc_env'
Steps to replicate
Install pyenv and python 3.11.9
Install pipenv and setuptools==74.1.2
Inside virtual environment, install setuptools==68.0.0 and try to build pyzmq==23.2.0
Inspect PYTHONPATH inside virtual environment
Please note that I have auto_activate_base: false in my .condarc file.
@oz123 I think the current behavior is quite counter-intuitive, but I don't know enough to give an informed opinion on this topic. When I have time (not likely anytime soon), I will dive into venv activate script to confirm your hypothesis.
Issue description
I have
pyenv
withpython
3.11.9 installed. This "default" installation hassetuptools
==74.1.2 and I used it to create a virtual environment viapipenv
.Now inside this virtual environment (with
pipenv shell
), I'm trying to install an older version of a package. There is no binary available, sopip
tries to build it from source. This particular version of the package needssetuptools
==68.0.0, so I installed it in the virtual environment. The problem is myPYTHONPATH
ordering seems to be prioritizing the lib from the "default" installation instead of the lib from the virtual environment, so the build fails.Current python path from
sys.path
:I think the last entry there should be at the top to fix this issue.
I believe pip is using
setuptools
==74.1.2 to build (and failed) because the build process looks forsetuptools.msvc.msvc14_get_vc_env
which was presented insetuptools
==68.0.0, but not in 74.1.2.Expected result
pip
build should be able to findsetuptools
==68.0.0Actual result
AttributeError: module 'setuptools.msvc' has no attribute 'msvc14_get_vc_env'
Traceback (most recent call last): File "C:\Users\redacted-user\.virtualenvs\redacted-hashdVal\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in main() File "C:\Users\redacted-user\.virtualenvs\redacted-hashdVal\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\redacted-user\.virtualenvs\redacted-hashdVal\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\build_meta.py", line 332, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\build_meta.py", line 302, in _get_build_requires self.run_setup() File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\build_meta.py", line 318, in run_setup exec(code, locals()) File "", line 1375, in File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\__init__.py", line 117, in setup return distutils.core.setup(**attrs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 184, in setup return run_commands(dist) ^^^^^^^^^^^^^^^^^^ File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 200, in run_commands dist.run_commands() File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 954, in run_commands self.run_command(cmd) File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\dist.py", line 950, in run_command super().run_command(command) File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_command cmd_obj.run() File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 311, in run self.find_sources() File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 319, in find_sources mm.run() File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 540, in run self.add_defaults() File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 578, in add_defaults sdist.add_defaults(self) File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\command\sdist.py", line 108, in add_defaults super().add_defaults() File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 250, in add_defaults self._add_defaults_ext() File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 334, in _add_defaults_ext build_ext = self.get_finalized_command('build_ext') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 303, in get_finalized_command cmd_obj.ensure_finalized() File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 111, in ensure_finalized self.finalize_options() File "", line 1112, in finalize_options File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\dist.py", line 950, in run_command super().run_command(command) File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 972, in run_command cmd_obj.ensure_finalized() File "C:\Users\redacted-user\AppData\Local\Temp\pip-build-env-0k9rsanh\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 111, in ensure_finalized self.finalize_options() File "", line 359, in finalize_options File "C:\Users\redacted-user\AppData\Local\Temp\pip-install-n00bj9jo\pyzmq_f14305d6a30a4a9aa78fa956e48cfef5\buildutils\misc.py", line 71, in locate_vcredist_dir vcvars = msvc.msvc14_get_vc_env(plat) ^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'setuptools.msvc' has no attribute 'msvc14_get_vc_env'Steps to replicate
pyenv
andpython
3.11.9pipenv
andsetuptools
==74.1.2setuptools
==68.0.0 and try to buildpyzmq
==23.2.0Please note that I have
auto_activate_base: false
in my.condarc
file.$ pipenv --support
Pipenv version:
'2024.0.1'
Pipenv location:
'C:\\Users\\redacted-user\\.pyenv\\pyenv-win\\versions\\3.11.9\\Lib\\site-packages\\pipenv'
Python location:
'C:\\Users\\redacted-user\\.pyenv\\pyenv-win\\versions\\3.11.9\\python.exe'
OS Name:
'nt'
User pip version:
'24.0'
user Python installations found:
PEP 508 Information:
System environment variables:
ALLUSERSPROFILE
APPDATA
BINDIR
CMDLINE
COMMANDS
COMMONPROGRAMFILES
COMMONPROGRAMFILES(X86)
COMMONPROGRAMW6432
COMPUTERNAME
COMSPEC
CONDA_BAT
CONDA_EXE
CONDA_PROMPT_MODIFIER
CONDA_SHLVL
DRIVERDATA
EXTRAPATHS
HOMEDRIVE
HOMEPATH
LOCALAPPDATA
LOGONSERVER
NUMBER_OF_PROCESSORS
NVM_HOME
NVM_SYMLINK
ONEDRIVE
ONEDRIVECOMMERCIAL
OS
PATH
PATHEXT
PIPENV_ACTIVE
PIPENV_SHELL
PIP_DISABLE_PIP_VERSION_CHECK
PIP_PYTHON_PATH
POSH_CURSOR_COLUMN
POSH_CURSOR_LINE
POSH_INSTALLER
POSH_PID
POSH_SHELL_VERSION
POSH_THEME
POSH_THEMES_PATH
POWERLINE_COMMAND
POWERSHELL_DISTRIBUTION_CHANNEL
POWERSHELL_UPDATECHECK
PROCESSOR_ARCHITECTURE
PROCESSOR_IDENTIFIER
PROCESSOR_LEVEL
PROCESSOR_REVISION
PROGRAMDATA
PROGRAMFILES
PROGRAMFILES(X86)
PROGRAMW6432
PROMPT
PSMODULEPATH
PUBLIC
PYENV
PYENV_HOME
PYENV_ROOT
PYTHONDONTWRITEBYTECODE
PYTHON_SHIMS
SESSIONNAME
SKIP
SYSTEMDRIVE
SYSTEMROOT
TEMP
TMP
UATDATA
USERDNSDOMAIN
USERDOMAIN
USERDOMAIN_ROAMINGPROFILE
USERNAME
USERPROFILE
VIRTUAL_ENV
WINDIR
WSLENV
WT_PROFILE_ID
WT_SESSION
ZES_ENABLE_SYSMAN
_CONDA_EXE
_CONDA_ROOT
_PATH
PYTHONFINDER_IGNORE_UNSUPPORTED
Pipenv–specific environment variables:
PIPENV_ACTIVE
:1
PIPENV_SHELL
:pwsh
Debug–specific environment variables:
PATH
:C:\Users\redacted-user\.pyenv\pyenv-win\versions\3.9.13;C:\Users\redacted-user\.pyenv\pyenv-win\versions\3.8.10;C:\Users\redacted-user\.pyenv\pyenv-win\versions\3.7.9;C:\Users\redacted-user\.pyenv\pyenv-win\versions\3.11.9;C:\Users\redacted-user\.pyenv\pyenv-win\versions\3.11.7;C:\Program Files\PowerShell\7;C:\Users\redacted-user\.virtualenvs\redacted-hashdVal\Scripts;C:\Users\redacted-user\.pyenv\pyenv-win\versions\3.11.9;C:\Users\redacted-user\.pyenv\pyenv-win\versions\3.11.9\Scripts;C:\Users\redacted-user\AppData\Roaming\Python\Python311\Scripts;C:\Users\redacted-user\Anaconda3\condabin;C:\Program Files\PowerShell\7;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Azure Data Studio\bin;C:\Program Files\dotnet\;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\Program Files (x86)\Microsoft SQL Server\160\DTS\Binn\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\redacted-user\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files\Git\cmd;C:\Program Files\PowerShell\7\;C:\Users\redacted-user\.pyenv\pyenv-win\bin;C:\Users\redacted-user\AppData\Local\Microsoft\WindowsApps;C:\Users\redacted-user\AppData\Local\Microsoft\WinGet\Packages\Databricks.DatabricksCLI_Microsoft.Winget.Source_8wekyb3d8bbwe;C:\Users\redacted-user\AppData\Local\Programs\Git\cmd;C:\Users\redacted-user\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\redacted-user\AppData\Roaming\nvm;C:\Users\redacted-user\.dotnet\tools;C:\Program Files\nodejs;C:\Program Files\qpdf 11.6.3\bin;C:\Users\redacted-user\AppData\Local\Programs\oh-my-posh\bin;C:\Users\redacted-user\.dotnet\tools;
VIRTUAL_ENV
:C:\Users\redacted-user\.virtualenvs\redacted-hashdVal
Contents of
Pipfile
('C:\Users\redacted-user\codes\redacted\Pipfile'):The text was updated successfully, but these errors were encountered: