4
I’m having a hard time creating a virtual environment with pipenv, I installed it without problems with the Pip, the problem happens at the time of creating the environment.
I’m using Windows 10 and Python 3.7.
I tried to install the pipenv using the command:
pip install pipenv
The installation did not show errors, but it gave problem when trying to create the environment. So I uninstalled everything and tried with:
pip install --user pipenv
Adjusting the environment variables as explained in the documentation, but also gave error when trying to create the environment.
I tried to create the virtual environment with the following commands:
pipenv install
pipenv install django
pipenv --three
What comes back to me:
Creating a virtualenv for this project…
Pipfile: C:\python\projeto\Pipfile
Using c:\users\usuário\appdata\local\programs\python\python37-32\python.exe
(3.7.0) to create virtualenv…
[=== ] Creating virtual environment...Already using interpreter
c:\users\usuário\appdata\local\programs\python\python37-32\python.exe
Using base prefix
'c:\\users\\usuário\\appdata\\local\\programs\\python\\python37-32'
New python executable in C:\python\projeto\.venv\Scripts\python.exe
Installing setuptools, pip, wheel...
Complete output from command C:\python\projeto\.venv\Scripts\python.exe -
setuptools pip wheel:
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
ModuleNotFoundError: No module named 'pkgutil'
----------------------------------------
...Installing setuptools, pip, wheel...done.
Failed creating virtual environment
[pipenv.exceptions.VirtualenvCreationException]: File
"c:\users\usuário\appdata\local\programs\python\python37-32\lib\site-
packages\pipenv\cli\command.py", line 254, in install
[pipenv.exceptions.VirtualenvCreationException]:
editable_packages=state.installstate.editables,
[pipenv.exceptions.VirtualenvCreationException]: File
"c:\users\usuário\appdata\local\programs\python\python37-32\lib\site-
packages\pipenv\core.py", line 1741, in do_install
[pipenv.exceptions.VirtualenvCreationException]:
pypi_mirror=pypi_mirror,
[pipenv.exceptions.VirtualenvCreationException]: File
"c:\users\usuário\appdata\local\programs\python\python37-32\lib\site-
packages\pipenv\core.py", line 574, in ensure_project
[pipenv.exceptions.VirtualenvCreationException]:
pypi_mirror=pypi_mirror,
[pipenv.exceptions.VirtualenvCreationException]: File
"c:\users\usuário\appdata\local\programs\python\python37-32\lib\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
"c:\users\usuário\appdata\local\programs\python\python37-32\lib\site-
packages\pipenv\core.py", line 935, in do_create_virtualenv
[pipenv.exceptions.VirtualenvCreationException]: extra=[crayons.blue("
{0}".format(c.err)),]
[pipenv.exceptions.VirtualenvCreationException]: Traceback (most recent call
last):
File "c:\users\usuário\appdata\local\programs\python\python37-
32\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\usuário\appdata\local\programs\python\python37-
32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "c:\users\usuário\appdata\local\programs\python\python37-32\lib\site-
packages\virtualenv.py", line 2462, in <module>
main()
File "c:\users\usuário\appdata\local\programs\python\python37-32\lib\site-
packages\virtualenv.py", line 762, in main
symlink=options.symlink,
File "c:\users\usuário\appdata\local\programs\python\python37-32\lib\site-
packages\virtualenv.py", line 1015, in create_environment
install_wheel(to_install, py_executable, search_dirs, download=download)
File "c:\users\usuário\appdata\local\programs\python\python37-32\lib\site-
packages\virtualenv.py", line 968, in install_wheel
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
File "c:\users\usuário\appdata\local\programs\python\python37-32\lib\site-
packages\virtualenv.py", line 854, in call_subprocess
raise OSError("Command {} failed with error code {}".format(cmd_desc,
proc.returncode))
OSError: Command C:\python\projeto\.venv\Scripts\python.exe - setuptools pip
wheel failed with error code 1
Failed to create virtual environment.
That question here did not help me much in this problem.
Someone has a light?
Thanks for the Django version tip! Regarding pipenv, I noticed that virtualenv gives this problem, so I tried to create the environment using venv and at first it is working well.
– Gau