我试图在Mac上从我自己的github本地运行一个现有的Django 1.9项目。
https://github.com/shanegibney/djangoForum.git
自从一年前发布到github以来,我已经从linux,Fedora转移到了mac。
我一直在遵循以下指示,
How to run cloned Django project?
$ mkdir djangoForum
$ cd djangoForum
$ virtualenv
$ git clone https://github.com/shanegibney/djangoForum.git
$ source env / bin / activate
$ cd djangoForum
$ pip install -r requirements.txt
这是我得到以下错误的地方,
(env) shanegibney at Shanes-MacBook-Pro in ~/djangoForum/djangoForum on master*
$ pip3 install -r requirements.txt
Collecting arrow==0.7.0 (from -r requirements.txt (line 1))
Using cached arrow-0.7.0.tar.gz
Collecting beautifulsoup4==4.4.1 (from -r requirements.txt (line 2))
Using cached beautifulsoup4-4.4.1-py3-none-any.whl
Collecting disqus==0.0.4 (from -r requirements.txt (line 3))
Using cached disqus-0.0.4.tar.gz
Collecting Django==1.10.2 (from -r requirements.txt (line 4))
Using cached Django-1.10.2-py2.py3-none-any.whl
Collecting django-allauth==0.25.2 (from -r requirements.txt (line 5))
Using cached django-allauth-0.25.2.tar.gz
Collecting django-allauth-bootstrap==0.1 (from -r requirements.txt (line 6))
Using cached django-allauth-bootstrap-0.1.tar.gz
Collecting django-emoticons==1.1.2 (from -r requirements.txt (line 7))
Using cached django_emoticons-1.1.2-py2.py3-none-any.whl
Collecting django-forms-bootstrap==3.0.1 (from -r requirements.txt (line 8))
Using cached django-forms-bootstrap-3.0.1.tar.gz
Collecting django-tinymce==2.3.0 (from -r requirements.txt (line 9))
Using cached django-tinymce-2.3.0.tar.gz
Collecting evernote==1.25.1 (from -r requirements.txt (line 10))
Using cached evernote-1.25.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/8z/jqnd9kp531q6h12pj95z0kwc0000gn/T/pip-build-_kcvo5hn/evernote/setup.py", line 6
exec x
^
SyntaxError: Missing parentheses in call to 'exec'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/8z/jqnd9kp531q6h12pj95z0kwc0000gn/T/pip-build-_kcvo5hn/evernote/
无论我使用pip还是pip3,错误都是一样的。
来自/Users/shanegibney/djangoForum/env/lib/python3.6/site-packages(python 3.6)的$ pip --version pip 9.0.1
$ python --version
Python 3.6.3
$ python
/用户/ shanegibney / djangoForum / ENV /斌/蟒蛇
$ python2
没有回报
requirements.txt文件在这里,
https://github.com/shanegibney/djangoForum/blob/master/requirements.txt
任何人都可以看到为什么我在尝试安装requirements.txt时出现错误?
尝试将我的virtualenv改为Python2,
$ virtualen-potton2 in
路径python2(来自--python = python2)不存在
Evernote SDK for Python只支持Python 2.你得到错误,因为你在Python 3中的虚拟环境。当你激活virtualenv时,pip
也会安装到Python 3 virtualenv中。
README有一个指向experimental repository for Python 3的链接。您可以尝试安装它,但您可能会在项目中发现其他不兼容性。您的另一个选择是在Python 2中运行您的项目。
如果您决定使用Python 2,那么请确保在创建virtualenv时使用Python 2,例如
virtualenv -p python2 v
然后在安装您的要求之前激活您的virtualenv。
仔细检查Python2是否在此项目中使用。如果是,请使用comment安装依赖项
pip install -r requirements.txt
如果使用Python3 +。使用注释使用Python3创建Virtualenv
virtualenv -p python3 env
并安装依赖项
pip3 install -r requirements.txt