如何克服“包装'whitenoise'需要另一个Python:2.7.16”错误?

问题描述 投票:0回答:1

我已经在MX linux-19中安装了python 3.8.2。但是,当我尝试在pycharm中安装django-heroku时,它说

错误:程序包'whitenoise'需要一个不同的Python:2.7.16不在'> = 3.5,<4

然后我安装了python 2.7.16,但没有卸载以前的最新版本。安装后,它再次出现相同的错误。我现在应该怎么办?

完整日志

$ pip install django-heroku

错误

> DEPRECATION: Python 2.7 reached the end of its life on January 1st,
> 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7.
> More details about Python 2 support in pip, can be found at
> https://pip.pypa.io/en/latest/development/release-process/#python-2-support
> Defaulting to user installation because normal site-packages is not
> writeable Collecting django-heroku   Using cached
> django_heroku-0.3.1-py2.py3-none-any.whl (6.2 kB) Collecting psycopg2 
> Using cached psycopg2-2.8.4.tar.gz (377 kB) Collecting whitenoise  
> Using cached whitenoise-5.0.1-py2.py3-none-any.whl (20 kB) ERROR:
> Package 'whitenoise' requires a different Python: 2.7.16 not in
> '>=3.5, <4'
python django pycharm
1个回答
0
投票

可能pycharm指向错误的python解释器版本。您可能需要自行配置。

File -> Settings -> Project: <project-name> -> Project Interpreter -> Click on the gear -> Add -> System Interpreter -> Select the correct python version -> OK

在这种情况下,尤其是检查Pycharm docs

© www.soinside.com 2019 - 2024. All rights reserved.