我正在开发一个既是库又是应用程序的Python / C ++项目。我遇到了运行
的问题$ pip install -r requirements.txt
两次给我以下错误(这是第二次运行):
$ pip install -r requirements.txt
Obtaining file:///Users/aaragon/Local/myproject (from -r requirements.txt (line 3))
Requirement already satisfied: numpy in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: scipy in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: Sphinx in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: pytest in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: matplotlib in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: dill in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: alabaster<0.8,>=0.7 in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from Sphinx-> myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: setuptools in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from Sphinx-> myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: docutils>=0.11 in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from Sphinx-> myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: snowballstemmer>=1.1 in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from Sphinx-> myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: six>=1.5 in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from Sphinx-> myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: babel!=2.0,>=1.3 in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from Sphinx-> myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: Pygments>=2.0 in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from Sphinx-> myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: requests>=2.0.0 in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from Sphinx-> myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: sphinxcontrib-websupport in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from Sphinx-> myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: Jinja2>=2.3 in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from Sphinx-> myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: imagesize in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from Sphinx-> myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: py>=1.4.33 in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from pytest-> myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: pytz in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from matplotlib-> myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: python-dateutil>=2.0 in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from matplotlib-> myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: cycler>=0.10 in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from matplotlib-> myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from matplotlib-> myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from requests>=2.0.0->Sphinx-> myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: certifi>=2017.4.17 in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from requests>=2.0.0->Sphinx-> myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: idna<2.7,>=2.5 in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from requests>=2.0.0->Sphinx-> myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from requests>=2.0.0->Sphinx-> myproject ==0.21.0->-r requirements.txt (line 3))
Requirement already satisfied: MarkupSafe>=0.23 in /Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages (from Jinja2>=2.3->Sphinx-> myproject ==0.21.0->-r requirements.txt (line 3))
Installing collected packages: myproject
Found existing installation: myproject 0.21.0
Exception:
Traceback (most recent call last):
File "/Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/Users/aaragon/.virtualenvs/test/lib/python3.5/site-packages/pip/req/req_install.py", line 703, in uninstall
'(at %s)' % (link_pointer, self.name, dist.location)
AssertionError: Egg-link /Users/aaragon/Local/myproject does not match installed location of myproject (at /Users/aaragon/Local/myproject/src)
我需要尽可能多次运行它,因为pip install
将成为Makefile的一部分或者缩短应用程序最终用户的生命。
我发现这个问题只有one post,但找不到解决方案的路径。
答案 0 :(得分:0)
这种情况发生在我身上,因为在错误的地方有一个myProject.egg-info文件夹,Pip似乎在尝试卸载它时会失败。我删除了这个,重新pip install -r requirements.txt
,文件夹已安装到指定的正确位置。