简体   繁体   English

为 DJango 安装 virtualenv 的问题

[英]Issue with installing virtualenv for DJango

I am installing virtualenv for my DJango project.我正在为我的 DJango 项目安装 virtualenv。 I have used:我用过:

    virtualenv venv

    virtualenv venv -p {myPath}Python/Python37-32/python

but all of theese have thrown the same error:但所有这些都抛出了同样的错误:

    Complete output from command E:\DJango\firstTutor...2\Scripts\python.exe - setuptools pip wheel:
      Traceback (most recent call last):
      File "<stdin>", line 3, in <module>
    ModuleNotFoundError: No module named 'pkgutil'

I am using the latest versions of Python, pip and virtualenv.我正在使用最新版本的 Python、pip 和 virtualenv。

Instead of using virtualenv try using the built in python venv .而不是使用 virtualenv 尝试使用内置的 python venv Ie: IE:

python3 -m venv name_of_virtual_environment

If you don't have python3 added to path then replace it with the path to your python.exe如果您没有将 python3 添加到路径中,请将其替换为 python.exe 的路径

pkgutil is a built-in module so it does not need to be installed when creating a new virtual environment. pkgutil是一个内置模块,因此在创建新的虚拟环境时不需要安装它。

Try this python3 -m venv /path/to/new/virtual/environment试试这个 python3 -m venv /path/to/new/virtual/environment

python3 -m venv /path/to/new/virtual/environment

For more info you can go below link有关更多信息,您可以在下面的链接 go

[ https://docs.python.org/3/library/venv.html] [ https://docs.python.org/3/library/venv.html]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM