繁体   English   中英

为什么我的 Apache-Beam Python 库安装失败?

[英]Why is my install failing for Apache-Beam Python library?

我正在运行 Python 2.7 并尝试安装 Apache-Beam。

我运行这个命令:python -m pip install apache-beam。 下面输出。

当我尝试运行引用库的代码时出现此错误,安装一定失败:“没有名为 apache_beam 的模块”

任何帮助深表感谢。

这是安装的输出:

(base) C:\Users\ned06>python -m pip install apache-beam
Collecting apache-beam
Collecting pyvcf<0.7.0,>=0.6.8 (from apache-beam)
  Using cached https://files.pythonhosted.org/packages/20/b6/36bfb1760f6983788d9
16096193fc14c83cce512c7787c93380e09458c09/PyVCF-0.6.8.tar.gz
Requirement already satisfied: six<1.12,>=1.9 in c:\users\ned06\appdata\local\co
ntinuum\anaconda2\lib\site-packages (from apache-beam) (1.11.0)
Requirement already satisfied: pyyaml<4.0.0,>=3.12 in c:\users\ned06\appdata\loc
al\continuum\anaconda2\lib\site-packages (from apache-beam) (3.12)
Requirement already satisfied: typing<3.7.0,>=3.6.0 in c:\users\ned06\appdata\lo
cal\continuum\anaconda2\lib\site-packages (from apache-beam) (3.6.4)
Requirement already satisfied: pydot<1.3,>=1.2.0 in c:\users\ned06\appdata\local
\continuum\anaconda2\lib\site-packages (from apache-beam) (1.2.4)
Requirement already satisfied: oauth2client<5,>=2.0.1 in c:\users\ned06\appdata\
local\continuum\anaconda2\lib\site-packages (from apache-beam) (4.1.2)
Requirement already satisfied: dill<=0.2.8.2,>=0.2.6 in c:\users\ned06\appdata\l
ocal\continuum\anaconda2\lib\site-packages (from apache-beam) (0.2.6)
Requirement already satisfied: pytz<=2018.4,>=2018.3 in c:\users\ned06\appdata\l
ocal\continuum\anaconda2\lib\site-packages (from apache-beam) (2018.4)
Requirement already satisfied: hdfs<3.0.0,>=2.1.0 in c:\users\ned06\appdata\loca
l\continuum\anaconda2\lib\site-packages (from apache-beam) (2.1.0)
Requirement already satisfied: protobuf<4,>=3.5.0.post1 in c:\users\ned06\appdat
a\local\continuum\anaconda2\lib\site-packages (from apache-beam) (3.6.0)
Requirement already satisfied: grpcio<2,>=1.8 in c:\users\ned06\appdata\local\co
ntinuum\anaconda2\lib\site-packages (from apache-beam) (1.14.2)
Requirement already satisfied: futures<4.0.0,>=3.1.1 in c:\users\ned06\appdata\l
ocal\continuum\anaconda2\lib\site-packages (from apache-beam) (3.2.0)
Requirement already satisfied: mock<3.0.0,>=1.0.1 in c:\users\ned06\appdata\loca
l\continuum\anaconda2\lib\site-packages (from apache-beam) (2.0.0)
Requirement already satisfied: httplib2<=0.11.3,>=0.8 in c:\users\ned06\appdata\
local\continuum\anaconda2\lib\site-packages (from apache-beam) (0.9.2)
Requirement already satisfied: crcmod<2.0,>=1.7 in c:\users\ned06\appdata\local\
continuum\anaconda2\lib\site-packages (from apache-beam) (1.7)
Requirement already satisfied: avro<2.0.0,>=1.8.1 in c:\users\ned06\appdata\loca
l\continuum\anaconda2\lib\site-packages (from apache-beam) (1.8.2)
Requirement already satisfied: future<1.0.0,>=0.16.0 in c:\users\ned06\appdata\l
ocal\continuum\anaconda2\lib\site-packages (from apache-beam) (0.16.0)
Requirement already satisfied: setuptools in c:\users\ned06\appdata\local\contin
uum\anaconda2\lib\site-packages (from pyvcf<0.7.0,>=0.6.8->apache-beam) (40.2.0)

Requirement already satisfied: pyparsing>=2.1.4 in c:\users\ned06\appdata\local\
continuum\anaconda2\lib\site-packages (from pydot<1.3,>=1.2.0->apache-beam) (2.2
.0)
Requirement already satisfied: pyasn1-modules>=0.0.5 in c:\users\ned06\appdata\l
ocal\continuum\anaconda2\lib\site-packages (from oauth2client<5,>=2.0.1->apache-
beam) (0.2.2)
Requirement already satisfied: pyasn1>=0.1.7 in c:\users\ned06\appdata\local\con
tinuum\anaconda2\lib\site-packages (from oauth2client<5,>=2.0.1->apache-beam) (0
.4.3)
Requirement already satisfied: rsa>=3.1.4 in c:\users\ned06\appdata\local\contin
uum\anaconda2\lib\site-packages (from oauth2client<5,>=2.0.1->apache-beam) (3.4.
2)
Requirement already satisfied: pyreadline>=1.7.1 in c:\users\ned06\appdata\local
\continuum\anaconda2\lib\site-packages (from dill<=0.2.8.2,>=0.2.6->apache-beam)
 (2.1)
Requirement already satisfied: docopt in c:\users\ned06\appdata\local\continuum\
anaconda2\lib\site-packages (from hdfs<3.0.0,>=2.1.0->apache-beam) (0.6.2)
Requirement already satisfied: requests>=2.7.0 in c:\users\ned06\appdata\local\c
ontinuum\anaconda2\lib\site-packages (from hdfs<3.0.0,>=2.1.0->apache-beam) (2.1
8.4)
Requirement already satisfied: enum34>=1.0.4 in c:\users\ned06\appdata\local\con
tinuum\anaconda2\lib\site-packages (from grpcio<2,>=1.8->apache-beam) (1.1.6)
Requirement already satisfied: funcsigs>=1; python_version < "3.3" in c:\users\n
ed06\appdata\local\continuum\anaconda2\lib\site-packages (from mock<3.0.0,>=1.0.
1->apache-beam) (1.0.2)
Requirement already satisfied: pbr>=0.11 in c:\users\ned06\appdata\local\continu
um\anaconda2\lib\site-packages (from mock<3.0.0,>=1.0.1->apache-beam) (4.2.0)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\users\ned06\appdata\l
ocal\continuum\anaconda2\lib\site-packages (from requests>=2.7.0->hdfs<3.0.0,>=2
.1.0->apache-beam) (3.0.4)
Requirement already satisfied: idna<2.7,>=2.5 in c:\users\ned06\appdata\local\co
ntinuum\anaconda2\lib\site-packages (from requests>=2.7.0->hdfs<3.0.0,>=2.1.0->a
pache-beam) (2.6)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in c:\users\ned06\appdata\l
ocal\continuum\anaconda2\lib\site-packages (from requests>=2.7.0->hdfs<3.0.0,>=2
.1.0->apache-beam) (1.22)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\ned06\appdata\loca
l\continuum\anaconda2\lib\site-packages (from requests>=2.7.0->hdfs<3.0.0,>=2.1.
0->apache-beam) (2018.4.16)
Building wheels for collected packages: pyvcf
  Running setup.py bdist_wheel for pyvcf ... error
  Complete output from command C:\Users\ned06\AppData\Local\Continuum\anaconda2\
python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\ned06\\appdat
a\\local\\temp\\pip-install-qtjnbs\\pyvcf\\setup.py';f=getattr(tokenize, 'open',
 open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code
, __file__, 'exec'))" bdist_wheel -d c:\users\ned06\appdata\local\temp\pip-wheel
-jrn5sw --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win32-2.7
  creating build\lib.win32-2.7\vcf
  copying vcf\filters.py -> build\lib.win32-2.7\vcf
  copying vcf\model.py -> build\lib.win32-2.7\vcf
  copying vcf\parser.py -> build\lib.win32-2.7\vcf
  copying vcf\sample_filter.py -> build\lib.win32-2.7\vcf
  copying vcf\utils.py -> build\lib.win32-2.7\vcf
  copying vcf\__init__.py -> build\lib.win32-2.7\vcf
  creating build\lib.win32-2.7\vcf\test
  copying vcf\test\prof.py -> build\lib.win32-2.7\vcf\test
  copying vcf\test\test_vcf.py -> build\lib.win32-2.7\vcf\test
  copying vcf\test\__init__.py -> build\lib.win32-2.7\vcf\test
  running egg_info
  writing requirements to PyVCF.egg-info\requires.txt
  writing PyVCF.egg-info\PKG-INFO
  writing top-level names to PyVCF.egg-info\top_level.txt
  writing dependency_links to PyVCF.egg-info\dependency_links.txt
  writing entry points to PyVCF.egg-info\entry_points.txt
  reading manifest file 'PyVCF.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'PyVCF.egg-info\SOURCES.txt'
  copying vcf\cparse.pyx -> build\lib.win32-2.7\vcf
  running build_ext
  cythoning vcf/cparse.pyx to vcf\cparse.c
  warning: vcf\cparse.pyx:16:14: Non-trivial type declarators in shared declarat
ion (e.g. mix of pointers and values). Each pointer declaration should be on its
 own line.
  warning: vcf\cparse.pyx:16:21: Non-trivial type declarators in shared declarat
ion (e.g. mix of pointers and values). Each pointer declaration should be on its
 own line.
  warning: vcf\cparse.pyx:16:27: Non-trivial type declarators in shared declarat
ion (e.g. mix of pointers and values). Each pointer declaration should be on its
 own line.
  warning: vcf\cparse.pyx:16:40: Non-trivial type declarators in shared declarat
ion (e.g. mix of pointers and values). Each pointer declaration should be on its
 own line.
  building 'vcf.cparse' extension
  error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpytho
n27

  ----------------------------------------
  Failed building wheel for pyvcf
  Running setup.py clean for pyvcf
Failed to build pyvcf
Installing collected packages: pyvcf, apache-beam
  Running setup.py install for pyvcf ... error
    Complete output from command C:\Users\ned06\AppData\Local\Continuum\anaconda
2\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\ned06\\appd
ata\\local\\temp\\pip-install-qtjnbs\\pyvcf\\setup.py';f=getattr(tokenize, 'open
', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(co
de, __file__, 'exec'))" install --record c:\users\ned06\appdata\local\temp\pip-r
ecord-3ugbtb\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-2.7
    creating build\lib.win32-2.7\vcf
    copying vcf\filters.py -> build\lib.win32-2.7\vcf
    copying vcf\model.py -> build\lib.win32-2.7\vcf
    copying vcf\parser.py -> build\lib.win32-2.7\vcf
    copying vcf\sample_filter.py -> build\lib.win32-2.7\vcf
    copying vcf\utils.py -> build\lib.win32-2.7\vcf
    copying vcf\__init__.py -> build\lib.win32-2.7\vcf
    creating build\lib.win32-2.7\vcf\test
    copying vcf\test\prof.py -> build\lib.win32-2.7\vcf\test
    copying vcf\test\test_vcf.py -> build\lib.win32-2.7\vcf\test
    copying vcf\test\__init__.py -> build\lib.win32-2.7\vcf\test
    running egg_info
    writing requirements to PyVCF.egg-info\requires.txt
    writing PyVCF.egg-info\PKG-INFO
    writing top-level names to PyVCF.egg-info\top_level.txt
    writing dependency_links to PyVCF.egg-info\dependency_links.txt
    writing entry points to PyVCF.egg-info\entry_points.txt
    reading manifest file 'PyVCF.egg-info\SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'PyVCF.egg-info\SOURCES.txt'
    copying vcf\cparse.pyx -> build\lib.win32-2.7\vcf
    running build_ext
    skipping 'vcf\cparse.c' Cython extension (up-to-date)
    building 'vcf.cparse' extension
    error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpyt
hon27

    ----------------------------------------
Command "C:\Users\ned06\AppData\Local\Continuum\anaconda2\python.exe -u -c "impo
rt setuptools, tokenize;__file__='c:\\users\\ned06\\appdata\\local\\temp\\pip-in
stall-qtjnbs\\pyvcf\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=
f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))"
install --record c:\users\ned06\appdata\local\temp\pip-record-3ugbtb\install-rec
ord.txt --single-version-externally-managed --compile" failed with error code 1
in c:\users\ned06\appdata\local\temp\pip-install-qtjnbs\pyvcf\

在错误日志即将结束时:

error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27

这表明您的问题源于Microsoft Visual C ++的过时/缺乏。 您可以在这里安装。

Python SDK 支持 Python 3.6、3.7 和 3.8。 Beam 2.24.0 是最后一个支持 Python 2.7 和 3.5 的版本。

# if you are still working with pathon2.7 try this,
pip install apache-beam==2.24.0

我想给你一个建议。尝试在虚拟环境中使用python3

# Check your version
python --version

# upgrade pip
pip install --upgrade pip

#create virtual env
python -m venv myenv

# activate your virtual env
source myenv/bin/activate

# install beam
pip3 install apache-beam==2.27.0 or
pip install apache-beam==2.27.0

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM