Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/312.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';t在python 2.7(Os:Fedora)上安装垃圾邮件_Python_Linux_Pip_Pyinstaller - Fatal编程技术网

Can';t在python 2.7(Os:Fedora)上安装垃圾邮件

Can';t在python 2.7(Os:Fedora)上安装垃圾邮件,python,linux,pip,pyinstaller,Python,Linux,Pip,Pyinstaller,我尝试使用PiP命令安装垃圾邮件,但出现以下错误: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-build-zI4__D/spams/setup.py", line 121, in <module> with open(os.path.join(this_directory,

我尝试使用PiP命令安装垃圾邮件,但出现以下错误:

 Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-zI4__D/spams/setup.py", line 121, in <module>
    with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
TypeError: 'encoding' is an invalid keyword argument for this function
    warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it with " \
  ^
/usr/bin/ld: cannot find -lblas
/usr/bin/ld: cannot find -llapack
collect2: error: ld returned 1 exit status
error: Command "g++ -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/spams_wrap/spams_wrap.o -L/usr/local/lib64 -L/usr/local/lib -L/usr/lib64 -L/usr/lib -L/usr/lib/ -L/usr/lib64 -lstdc++ -lblas -llapack -lpython2.7 -o build/lib.linux-x86_64-2.7/_spams_wrap.so -fopenmp" failed with exit status 1
    error: Command "gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_           FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4            -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG            -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong            --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOUR           CE -fPIC -fwrapv -fPIC -I. -Ispams/linalg -Ispams/prox -Ispams/decomp -Ispams/di           ctLearn -I/home/aabdelli/.local/lib/python2.7/site-packages/numpy/core/include -           I/usr/include/python2.7 -I/usr/local/include -I/usr/include -I/usr/include/pytho           n2.7 -c spams_wrap.cpp -o build/temp.linux-x86_64-2.7/spams_wrap.o -DNDEBUG -DUS           E_BLAS_LIB -std=c++11 -fPIC -fopenmp -Wunused-variable -m64" failed with exit st           atus 1

    ----------------------------------------
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-           build-8cd3Ds/spams/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file           __).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-           OH2Naf-record/install-record.txt --single-version-externally-managed --compile -           -user --prefix=" failed with error code 1 in /tmp/pip-build-8cd3Ds/spams/
当我尝试“pip安装垃圾邮件==2.6.1”时,会出现以下错误:

 Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-zI4__D/spams/setup.py", line 121, in <module>
    with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
TypeError: 'encoding' is an invalid keyword argument for this function
    warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it with " \
  ^
/usr/bin/ld: cannot find -lblas
/usr/bin/ld: cannot find -llapack
collect2: error: ld returned 1 exit status
error: Command "g++ -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/spams_wrap/spams_wrap.o -L/usr/local/lib64 -L/usr/local/lib -L/usr/lib64 -L/usr/lib -L/usr/lib/ -L/usr/lib64 -lstdc++ -lblas -llapack -lpython2.7 -o build/lib.linux-x86_64-2.7/_spams_wrap.so -fopenmp" failed with exit status 1
    error: Command "gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_           FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4            -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG            -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong            --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOUR           CE -fPIC -fwrapv -fPIC -I. -Ispams/linalg -Ispams/prox -Ispams/decomp -Ispams/di           ctLearn -I/home/aabdelli/.local/lib/python2.7/site-packages/numpy/core/include -           I/usr/include/python2.7 -I/usr/local/include -I/usr/include -I/usr/include/pytho           n2.7 -c spams_wrap.cpp -o build/temp.linux-x86_64-2.7/spams_wrap.o -DNDEBUG -DUS           E_BLAS_LIB -std=c++11 -fPIC -fopenmp -Wunused-variable -m64" failed with exit st           atus 1

    ----------------------------------------
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-           build-8cd3Ds/spams/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file           __).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-           OH2Naf-record/install-record.txt --single-version-externally-managed --compile -           -user --prefix=" failed with error code 1 in /tmp/pip-build-8cd3Ds/spams/

第一次升级
pip

pip install -U pip setuptools
安装之前,请先安装spam'
setup.py
,因此首先必须安装
numpy

pip install numpy
SPAM需要BLAS和LAPACK。您需要安装Fedora的库。看见试一试

然后用spam:

pip install spams==2.6.1

Python 2.7不再受支持。编码是一种非常类似python-3的东西。考虑切换到Python 3。支持什么,不懂!!我不能切换到python3,因为它不是我的机器。对于编码问题,我修复了Python开发人员不再支持它的问题:。Numpy也有一段时间不支持python 2了。设置#定义警告提示您要绕过的内容。不过,我想你还需要做更多的工作才能让它正常工作。不要同时安装。编辑你的问题并显示错误文本。好的,我编辑了它。我做了更多的调查并重写了答案。