ModuleNotFoundError:没有名为"html.entities"的模块;"html"不是一个包



这里是新手编码器。所以我试图用pipenv安装django,但我一直收到这个错误:

$ pipenv install django
Creating a virtualenv for this project...
Pipfile: C:Userswesleyromero308DesktopPipfile
Using C:/Users/wesleyromero308/AppData/Local/Programs/Python/Python38/python.exe (3.8.0) to create virtualenv...
[=   ] Creating virtual environment...ModuleNotFoundError: No module named 'html.entities'; 'html' is not a package
Failed creating virtual environment
[pipenv.exceptions.VirtualenvCreationException]: 2022-08-06 01:08:46.004 ERROR   root: ModuleNotFoundError: No module named 'html.entities'; 'html' is not a package
Failed to create virtual environment.

然后我去做了pip安装htmlentities,它是成功的。然后我做了pip安装html,得到了这个错误:

$ pip install html
Collecting html
Using cached html-1.16.tar.gz (7.6 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'error'
error: subprocess-exited-with-error
python setup.py egg_ifo did not run successfully.
exit code: 1
[1 lines of output]
ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Encountered error while generating package metadata.
See above for output.

请帮忙,我只想安装django lol我已经被困了好几天了

关于您的错误

无法执行setup.py,因为setuptools在生成环境中不可用。

html软件包需要setuptoolspkg安装第一个

使用创建VirtualEnv:

cd project
python3.8 -m venv <name-of-your-env>
# activate the virtual env just created
source bin/<name-of-your-env>/activate

现在安装Django应该可以了:

pip install Django

如果要停用虚拟环境

cd project
deactivate

相关内容

  • 没有找到相关文章

最新更新