-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
RuntimeError: 'Exec format error' when using pipenv+pyenv-installed python 3.8.1 to install environment #1545
Comments
What's the content of the executable in question? Says it's not executable 🤔 Can you post please the output by passing the -vvv flag? Please also attach the ls -al of the executable in question. Thanks! |
Please also attach the command you've used to install your pyenv python in question 😊 |
This issue still needs a small reproducible script, I'm failing to do so. A run with |
A reproducible script for me was
and I get the following output:
|
Can you please post the output by passing -vvv to the virtualenv command. |
|
I'm a little sad we still released while we had identified this during the beta period -- would have been nice to work this out instead of having users pester downstream packages about this pre-commit/pre-commit#1327 |
here's what I'm getting: $ virtualenv -vvv vvv -p python2.7
69 setup logging to NOTSET [DEBUG report:43]
75 find interpreter for spec PythonSpec(implementation=CPython, major=2, minor=7) [INFO builtin:44]
75 discover system for PythonInfo(spec=CPython3.7.2.final.0-64, exe=/private/tmp/venv/bin/python3, platform=darwin, version='3.7.2 (v3.7.2:9a3ffc0492, Dec 24 2018, 02:44:43) \n[Clang 6.0 (clang-600.0.57)]', encoding_fs_io=utf-8-UTF-8) in /Library/Frameworks/Python.framework/Versions/3.7 [DEBUG py_info:332]
77 filesystem is not case-sensitive [DEBUG info:28]
79 Attempting to acquire lock 4549774472 on /Users/asottile/Library/Application Support/virtualenv/py-info/20.0.1/fb7ec9939e66e8ed189e2fe772cae61fcc992510c23be22bd7dadeab5367beb4.lock [DEBUG filelock:270]
79 Lock 4549774472 acquired on /Users/asottile/Library/Application Support/virtualenv/py-info/20.0.1/fb7ec9939e66e8ed189e2fe772cae61fcc992510c23be22bd7dadeab5367beb4.lock [INFO filelock:274]
79 get interpreter info via cmd: /Library/Frameworks/Python.framework/Versions/3.7/python -s /private/tmp/venv/lib/python3.7/site-packages/virtualenv/discovery/py_info.py [DEBUG cached_py_info:107]
81 Attempting to release lock 4549774472 on /Users/asottile/Library/Application Support/virtualenv/py-info/20.0.1/fb7ec9939e66e8ed189e2fe772cae61fcc992510c23be22bd7dadeab5367beb4.lock [DEBUG filelock:315]
82 Lock 4549774472 released on /Users/asottile/Library/Application Support/virtualenv/py-info/20.0.1/fb7ec9939e66e8ed189e2fe772cae61fcc992510c23be22bd7dadeab5367beb4.lock [INFO filelock:318]
82 done in 80ms [INFO __main__:26]
82 RuntimeError: failed to query /Library/Frameworks/Python.framework/Versions/3.7/python with code 8 err: 'Exec format error' [ERROR __main__:33]
Traceback (most recent call last):
File "/private/tmp/venv/bin/virtualenv", line 8, in <module>
sys.exit(run_with_catch())
File "/private/tmp/venv/lib/python3.7/site-packages/virtualenv/__main__.py", line 31, in run_with_catch
run(args)
File "/private/tmp/venv/lib/python3.7/site-packages/virtualenv/__main__.py", line 19, in run
run_via_cli(args)
File "/private/tmp/venv/lib/python3.7/site-packages/virtualenv/run/__init__.py", line 21, in run_via_cli
session = session_via_cli(args)
File "/private/tmp/venv/lib/python3.7/site-packages/virtualenv/run/__init__.py", line 28, in session_via_cli
parser = build_parser(args)
File "/private/tmp/venv/lib/python3.7/site-packages/virtualenv/run/__init__.py", line 41, in build_parser
parser._interpreter = interpreter = discover.interpreter
File "/private/tmp/venv/lib/python3.7/site-packages/virtualenv/discovery/discover.py", line 44, in interpreter
self._interpreter = self.run()
File "/private/tmp/venv/lib/python3.7/site-packages/virtualenv/discovery/builtin.py", line 33, in run
return get_interpreter(self.python_spec)
File "/private/tmp/venv/lib/python3.7/site-packages/virtualenv/discovery/builtin.py", line 46, in get_interpreter
for interpreter, impl_must_match in propose_interpreters(spec):
File "/private/tmp/venv/lib/python3.7/site-packages/virtualenv/discovery/builtin.py", line 63, in propose_interpreters
yield PythonInfo.current_system(), True
File "/private/tmp/venv/lib/python3.7/site-packages/virtualenv/discovery/py_info.py", line 268, in current_system
cls._current_system = cls.from_exe(sys.executable, raise_on_error=True, resolve_to_host=True)
File "/private/tmp/venv/lib/python3.7/site-packages/virtualenv/discovery/py_info.py", line 290, in from_exe
proposed = proposed._resolve_to_system(proposed)
File "/private/tmp/venv/lib/python3.7/site-packages/virtualenv/discovery/py_info.py", line 318, in _resolve_to_system
target = target.discover_exe(prefix=prefix, exact=False)
File "/private/tmp/venv/lib/python3.7/site-packages/virtualenv/discovery/py_info.py", line 341, in discover_exe
info = self.from_exe(exe_path, resolve_to_host=False)
File "/private/tmp/venv/lib/python3.7/site-packages/virtualenv/discovery/py_info.py", line 287, in from_exe
proposed = from_exe(cls, exe, raise_on_error=raise_on_error, ignore_cache=ignore_cache)
File "/private/tmp/venv/lib/python3.7/site-packages/virtualenv/discovery/cached_py_info.py", line 37, in from_exe
raise result
RuntimeError: failed to query /Library/Frameworks/Python.framework/Versions/3.7/python with code 8 err: 'Exec format error' I had to adjust $ diff -u venv/lib/python3.7/site-packages/virtualenv/__main__.py{.old,}
--- venv/lib/python3.7/site-packages/virtualenv/__main__.py.old 2020-02-10 15:43:05.000000000 -0800
+++ venv/lib/python3.7/site-packages/virtualenv/__main__.py 2020-02-10 15:41:28.000000000 -0800
@@ -28,6 +28,7 @@
run(args)
except (KeyboardInterrupt, Exception) as exception:
logging.error("%s: %s", type(exception).__name__, exception)
+ raise
sys.exit(1)
|
note that I am not using pyenv, my python is acquired from homebrew |
@asottile did not need the stack trace, knew exactly where things fail, but needed to see the discovery trace to see where things go wrong. Thanks. |
@asottile how did you install virtualenv? |
the same as @smitt04's directions above |
Hello, a fix for this issue has been released via virtualenv 20.0.2; see https://pypi.org/project/virtualenv/20.0.2/ (https://virtualenv.pypa.io/en/latest/changelog.html#v20-0-2-2020-02-11) . Please give a try and report back if your issue has not been addressed; if not, please comment here, and we'll reopen the ticket. We want to apologize for the inconvenience this has caused you and say thanks for having patience while we resolve the unexpected bugs with this new major release. |
I get past the error now, but now I'm hitting #1583 from the same directions |
Thanks for submitting an issue!
If submitting a BUG please provide:
This gives me an output of
pip list
outputusing virtualenv 20.0.0b2
Please see this issue for more detail
The text was updated successfully, but these errors were encountered: