Pip无法在“ Vagrant”框中安装软件包,并且说缺少一个cymem文件。

时间:2019-02-01 02:30:44

标签: python pip vagrant

我正在使用Vagrant在Windows上编辑在Linux机器上编写的Python项目。这是Vagrantfile的文本:

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/bionic64"

config.vm.provider "virtualbox" do |v|
  v.name = "medaCy_box"
  end

config.vm.provision "shell", inline: <<-SHELL
    apt-get update
    apt-get install -y python3 python3-pip
    python3 -m pip install --upgrade pip
    pip3 install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz#egg=en_core_web_sm-2.0.0
    pip3 install -e /vagrant
SHELL
end

设置时,控制台的这两行会突出显示:

/tmp/vagrant-shell: line 4:  2903 Killed pip3 install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz#egg=en_core_web_sm-2.0.0

/tmp/vagrant-shell: line 5:  2911 Killed     pip3 install -e /vagrant

我决定通过SSH进入Vagrant,并从那里的命令行运行这两个步骤,以查看是否可以获得更多信息。我还尝试安装一些单独的软件包依赖项。每当我尝试使用pip3安装软件包时,都会收到以下两个错误消息之一或全部:

Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/home/vagrant/.local/lib/python3.6/site-packages/cymem-2.0.2.dist-info/RECORD'
FileNotFoundError: [Errno 2] No such file or directory: '/home/vagrant/.local/lib/python3.6/site-packages/cymem-2.0.2.dist-info/METADATA'

鉴于cymem的明显重要性,我尝试安装它并得到此错误:

Requirement already satisfied: cymem in /home/vagrant/.local/lib/python3.6/site-packages (2.0.2)
No metadata found in /home/vagrant/.local/lib/python3.6/site-packages
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/home/vagrant/.local/lib/python3.6/site-packages/cymem-2.0.2.dist-info/METADATA'

我导航到/home/vagrant/.local/lib/python3.6/site-packages/cymem-2.0.2.dist-info/,实际上METADATA文件在那里,并且不是空的。

我不知道为什么当我能够导航到并打开该文件时,会遇到与该文件不相关的问题。任何澄清将不胜感激。

0 个答案:

没有答案