-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
MSYS2: location not created nor specified #5446
Comments
You need to add your Python location to the PATH. |
Hello, @matteius! What Python location should I add to the PATH? $ echo $PATH Best regards, |
Hmm, I am not sure @Sonnayya -- have you tried using git shell for windows? It is a well maintained Mingw64 shell, I use it and havent't had problems. Check: https://gitforwindows.org/ |
@Sonnayya Were you able to get this sorted out? |
I afraid that if pip is installed by pacman (ex. mingw-w64-x86_64-python-pip), virtualenv activatation script's So, project.virtualenv_exists is False. Then project._which("python") fails. |
In windows msys2, references to Scripts directory should also check the bin directory. |
Please try with latest |
I tried pienv===2023.5.19, but encountered another issue. pipenv shell produced "RecursionError: maximum recursion depth exceeded". environment vairables
Used command
Output logs
|
I suspect that this original bug may be related to virtualenv rather than pipenv. Specifically, when running it with msys2, it creates the virtual_env/bin directory instead of virtual_env/Scripts. |
Do I need to add another issue for "RecursionError: maximum recursion depth exceeded" problem? |
@turutcrane Yeah it would be good to open an issue if you are getting that stack trace -- I haven't seen the maximum recursion depth exceeded problem on windows (git shell or power shell), ubuntu or mac os -- please provide as much detail as possible in the issue report. |
I have no idea how we are going to pick that one apart -- is there a way to detect the shell is definitely MSYS2? |
FWIW, I use Git Bash which under the hood uses MSYS2 according to the Task Manager, and I don't have this issue. |
I have found that 3 type pythons exist in in windows.
(I think that the one installed in the environment other than MSYS of MSYS2 is the same as 3. See. https://www.msys2.org/docs/environments/ ) My environment is 3rd. I execute this script in 3 environments.
Output by 1 (Officila windows build)
Output by 2 (MSYS environment in MSYS2)
2nd does not have nt module, So os.name == 'posix' Output by 3 (MINGW64 environment in MSYS2)
sysconfig.py of MINGW64 environment is patched by https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-python/0024-MINGW-generalization-of-posix-build-in-sysconfig.py.patch . I tryed that some (os.name == 'nt') condition by (os.name == 'nt' and 'nt' in sysconfig.get_default_scheme()), then P.S. |
@turutcrane the MSYS2 variable might be promising -- the problem with sysconfig is with older versions of python like 3.7 -- I tried to introduce some usage of it prior but it broke on certain linux systems. Anyway I've run out of time on pipenv things this week, will check back again soon. |
i have the same issue with mingw-w64's python install. From @turutcrane 's post it seems that the check should be based on scheme+os.name, not the env var name. |
Feel free to open a PR, my time is limited and may not be able to deep dive this soon. |
I'm also running into this issue, but hit a roadblock debugging it. I don't fully understand the suggestions from the previous comments, but as noted by @turutcrane we seem to be in a bit of a mixed state, with a posix scheme but nt for @property
def virtualenv_exists(self) -> bool:
if os.path.exists(self.virtualenv_location):
if os.name == "nt": # Issue here
extra = ["Scripts", "activate.bat"]
else:
extra = ["bin", "activate"]
... I can work around this by either symlinking the "bin" folder to "Scripts", or updating the above code to check But then I'm hitting another seemingly related issue when installing "PyGObject":
|
The above errors was solved by using the |
is this issue resolved? |
$ pipenv --support
Pipenv version:
'2022.10.25'
Pipenv location:
'C:/Users/andrey/.local/lib/python3.10-mingw_x86_64/site-packages/pipenv'
Python location:
'C:/msys64/mingw64/bin/python.exe'
OS Name:
'nt'
User pip version:
'22.3'
user Python installations found:
3.10.8
:C:/msys64/mingw64/bin/python.exe
3.10.8
:C:/msys64/mingw64/bin/python3.exe
3.10.8
:C:/msys64/mingw64/bin/python.exe
3.10.8
:C:/msys64/mingw64/bin/python3.exe
PEP 508 Information:
System environment variables:
ACLOCAL_PATH
ALLUSERSPROFILE
APPDATA
COMMONPROGRAMFILES
COMPUTERNAME
COMSPEC
CONFIG_SITE
COMMONPROGRAMFILES(X86)
COMMONPROGRAMW6432
DRIVERDATA
HOME
HOMEDRIVE
HOMEPATH
HOSTNAME
INFOPATH
LC_CTYPE
LOCALAPPDATA
LOGONSERVER
MANPATH
MINGW_CHOST
MINGW_PACKAGE_PREFIX
MINGW_PREFIX
MSYSCON
MSYSTEM
MSYSTEM_CARCH
MSYSTEM_CHOST
MSYSTEM_PREFIX
NUMBER_OF_PROCESSORS
OLDPWD
ORIGINAL_PATH
ORIGINAL_TEMP
ORIGINAL_TMP
OS
ONEDRIVE
PATH
PATHEXT
PKG_CONFIG_PATH
PRINTER
PROCESSOR_ARCHITECTURE
PROCESSOR_IDENTIFIER
PROCESSOR_LEVEL
PROCESSOR_REVISION
PROGRAMFILES
PS1
PSMODULEPATH
PUBLIC
PWD
PROGRAMDATA
PROGRAMFILES(X86)
PROGRAMW6432
PYCHARM COMMUNITY EDITION
SESSIONNAME
SHELL
SHLVL
SYSTEMDRIVE
SYSTEMROOT
TEMP
TERM
TERM_PROGRAM
TERM_PROGRAM_VERSION
TMP
USER
USERDOMAIN
USERDOMAIN_ROAMINGPROFILE
USERNAME
USERPROFILE
VBOX_MSI_INSTALL_PATH
WINDIR
WIX
XDG_DATA_DIRS
ZES_ENABLE_SYSMAN
_
PIP_DISABLE_PIP_VERSION_CHECK
PIP_PYTHON_PATH
PYTHONDONTWRITEBYTECODE
PYTHONFINDER_IGNORE_UNSUPPORTED
Pipenv–specific environment variables:
Debug–specific environment variables:
PATH
:C:\msys64\mingw64\bin;C:\msys64\usr\local\bin;C:\msys64\usr\bin;C:\msys64\usr\bin;C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\S ystem32\WindowsPowerShell\v1.0\;C:\msys64\usr\bin\site_perl;C:\msys64\usr\bin\vendor_perl;C:\msys64\usr\bin\core_perl;C:\Users\andrey\.local\bin;C:\msys64\mingw64\ bin\
SHELL
:C:\msys64\usr\bin\bash.exe
PWD
:C:/msys64/home/andrey/p1
Contents of
Pipfile
('C:/msys64/home/andrey/p1/Pipfile'):Contents of
Pipfile.lock
('C:/msys64/home/andrey/p1/Pipfile.lock'):I am trying to create virtual environment and I got error:
$ pipenv --python 3
Creating a virtualenv for this project...
Pipfile: C:/msys64/home/andrey/p1/Pipfile
Using C:/msys64/mingw64/bin/python3.exe (3.10.8) to create virtualenv...
[ ] Creating virtual environment...created virtual environment CPython3.10.8.final.0-64 in 531ms
creator Venv(dest=C:/Users/andrey/.virtualenvs/p1-E5LPA_VZ, clear=False, no_vcs_ignore=False, global=False, describe=CPython3Windows)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:/Users/andrey/AppData/Local/pypa/virtualenv)
added seed packages: pip==22.3, setuptools==65.5.0, wheel==0.37.1
activators BashActivator,BatchActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
Successfully created virtual environment!
Virtualenv location: C:/Users/andrey/.virtualenvs/p1-E5LPA_VZ
Traceback (most recent call last):
File "C:/msys64/mingw64/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:/msys64/mingw64/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:/Users/andrey/.local/bin/pipenv.exe/main.py", line 7, in
File "C:/Users/andrey/.local/lib/python3.10-mingw_x86_64/site-packages/pipenv/vendor/click/core.py", line 1128, in call
return self.main(*args, **kwargs)
File "C:/Users/andrey/.local/lib/python3.10-mingw_x86_64/site-packages/pipenv/cli/options.py", line 57, in main
return super().main(*args, **kwargs, windows_expand_args=False)
File "C:/Users/andrey/.local/lib/python3.10-mingw_x86_64/site-packages/pipenv/vendor/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "C:/Users/andrey/.local/lib/python3.10-mingw_x86_64/site-packages/pipenv/vendor/click/core.py", line 1637, in invoke
super().invoke(ctx)
File "C:/Users/andrey/.local/lib/python3.10-mingw_x86_64/site-packages/pipenv/vendor/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:/Users/andrey/.local/lib/python3.10-mingw_x86_64/site-packages/pipenv/vendor/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "C:/Users/andrey/.local/lib/python3.10-mingw_x86_64/site-packages/pipenv/vendor/click/decorators.py", line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "C:/Users/andrey/.local/lib/python3.10-mingw_x86_64/site-packages/pipenv/vendor/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "C:/Users/andrey/.local/lib/python3.10-mingw_x86_64/site-packages/pipenv/vendor/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "C:/Users/andrey/.local/lib/python3.10-mingw_x86_64/site-packages/pipenv/cli/command.py", line 207, in cli
ensure_project(
File "C:/Users/andrey/.local/lib/python3.10-mingw_x86_64/site-packages/pipenv/core.py", line 539, in ensure_project
path_to_python = project._which("python") or project._which("py")
File "C:/Users/andrey/.local/lib/python3.10-mingw_x86_64/site-packages/pipenv/project.py", line 1124, in _which
raise RuntimeError("location not created nor specified")
RuntimeError: location not created nor specified
The text was updated successfully, but these errors were encountered: