Skip to content
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

Occur error when create virtual environment in CentOS7 & python 2.7.5 #4249

Closed
mcauto opened this issue May 12, 2020 · 1 comment
Closed
Labels

Comments

@mcauto
Copy link

mcauto commented May 12, 2020

related issue: pypa/virtualenv#1810

Using /bin/python2.7 (2.7.5) to create virtualenv…
⠹ Creating virtual environment...RuntimeError: failed to query /bin/python2.7 with code 1 err: 'Traceback (most recent call last):\n  File "/usr/local/lib/python3.7/site-packages/virtualenv/discovery/py_info.py", line 487, in <module>\n    print(PythonInfo()._to_json())\n  File "/usr/local/lib/python3.7/site-packages/virtualenv/discovery/py_info.py", line 82, in __init__\n    ("makefile_filename", sysconfig.get_makefile_filename()),\nAttributeError: \'module\' object has no attribute \'get_makefile_filename\'\n'
✘ Failed creating virtual environment
[pipenv.exceptions.VirtualenvCreationException]:   File "/usr/local/lib/python3.7/site-packages/pipenv/cli/command.py", line 615, in sync
[pipenv.exceptions.VirtualenvCreationException]:       pypi_mirror=state.pypi_mirror,
[pipenv.exceptions.VirtualenvCreationException]:   File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 2597, in do_sync
[pipenv.exceptions.VirtualenvCreationException]:       pypi_mirror=pypi_mirror,
[pipenv.exceptions.VirtualenvCreationException]:   File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 574, in ensure_project
[pipenv.exceptions.VirtualenvCreationException]:       pypi_mirror=pypi_mirror,
[pipenv.exceptions.VirtualenvCreationException]:   File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 506, in ensure_virtualenv
[pipenv.exceptions.VirtualenvCreationException]:       python=python, site_packages=site_packages, pypi_mirror=pypi_mirror
[pipenv.exceptions.VirtualenvCreationException]:   File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 935, in do_create_virtualenv
[pipenv.exceptions.VirtualenvCreationException]:       extra=[crayons.blue("{0}".format(c.err)),]
[pipenv.exceptions.VirtualenvCreationException]:
@mcauto
Copy link
Author

mcauto commented May 12, 2020

I solve it!

I use python2.7.5, python3.6, python3.7

venv_check.py

import virtualenv
print(virtualenv.__version__)
$ python3.7 venv_check.py
20.0.19

$ python3.6 venv_check.py
20.0.20

solution

pip3.7 install --upgrade pip

@mcauto mcauto closed this as completed May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant