When I try to import the sawtooth SDK into Pycharm it failes with the following error
Collecting sawtooth-sdk==1.0.1
Using cached sawtooth-sdk-1.0.1.tar.gz
Requirement already satisfied: colorlog in /home/user/PycharmProjects/test/venv/lib/python3.6/site-packages (from sawtooth-sdk==1.0.1)
Collecting sawtooth-signing (from sawtooth-sdk==1.0.1)
Using cached sawtooth-signing-1.0.1.tar.gz
Collecting protobuf (from sawtooth-sdk==1.0.1)
Using cached protobuf-3.5.2.post1-cp36-cp36m-manylinux1_x86_64.whl
Collecting pyzmq (from sawtooth-sdk==1.0.1)
Using cached pyzmq-17.0.0-cp36-cp36m-manylinux1_x86_64.whl
Collecting toml (from sawtooth-sdk==1.0.1)
Using cached toml-0.9.4.tar.gz
Collecting PyYAML (from sawtooth-sdk==1.0.1)
Using cached PyYAML-3.12.tar.gz
Collecting secp256k1 (from sawtooth-signing->sawtooth-sdk==1.0.1)
Using cached secp256k1-0.13.2.tar.gz
Collecting six>=1.9 (from protobuf->sawtooth-sdk==1.0.1)
Using cached six-1.11.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools in /home/user/PycharmProjects/test/venv/lib/python3.6/site-packages (from protobuf->sawtooth-sdk==1.0.1)
Requirement already satisfied: cffi>=1.3.0 in /home/user/PycharmProjects/test/venv/lib/python3.6/site-packages (from secp256k1->sawtooth-signing->sawtooth-sdk==1.0.1)
Requirement already satisfied: pycparser in /home/user/PycharmProjects/test/venv/lib/python3.6/site-packages (from cffi>=1.3.0->secp256k1->sawtooth-signing->sawtooth-sdk==1.0.1)
Installing collected packages: secp256k1, sawtooth-signing, six, protobuf, pyzmq, toml, PyYAML, sawtooth-sdk
Running setup.py install for secp256k1: started
Running setup.py install for secp256k1: finished with status 'error'
Complete output from command /home/user/PycharmProjects/test/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pycharm-packaging/secp256k1/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-g3n5renb-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/PycharmProjects/test/venv/include/site/python3.6/secp256k1:
0.29.1
Installed libsecp256k1 is unusable falling back to bundled version.
Using bundled libsecp256k1
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/secp256k1
copying secp256k1/__init__.py -> build/lib.linux-x86_64-3.6/secp256k1
copying secp256k1/__main__.py -> build/lib.linux-x86_64-3.6/secp256k1
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
generating cffi module 'build/temp.linux-x86_64-3.6/_libsecp256k1.c'
creating build/temp.linux-x86_64-3.6
building '_libsecp256k1' extension
creating build/temp.linux-x86_64-3.6/build
creating build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/user/PycharmProjects/test/venv/include -I/usr/include/python3.6m -c build/temp.linux-x86_64-3.6/_libsecp256k1.c -o build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6/_libsecp256k1.o
build/temp.linux-x86_64-3.6/_libsecp256k1.c:22:24: fatal error: pyconfig.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/home/user/PycharmProjects/test/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pycharm-packaging/secp256k1/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-g3n5renb-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/PycharmProjects/test/venv/include/site/python3.6/secp256k1" failed with error code 1 in /tmp/pycharm-packaging/secp256k1/
When I run the pip command pip install sawtooth-sdk==1.0.1 it succeeds but it installs the files to python 2.7 version and I need to install it for python 3.6 which it is the interpreter I have use for this project. Or is there anyway to import them directly into pycharm from the folder of the sdk the sawtooth project provides?? Any help??
Use pip3 which is available for Ubuntu-16.04
sudo apt-get install python3-pip
sudo pip3 install sawtooth-sdk==1.0.1
Another solution for cases where you cannot change Python version: install secp256k1 library in system. For example, to install it on python3.7 docker image:
RUN apt update && apt install -y libsecp256k1-dev libsecp256k1-0
I changed the python interpreter to version 3.5 and it installed correctly
Related
I am trying to install fitsne in colab. Recommended way for installation is:
conda config --add channels conda-forge #if not already in your channels. Needed for fftw.
conda install cython numpy fftw
pip install fitsne
Yet, I get following error:
Requirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from fitsne) (1.19.5)
Requirement already satisfied: cython in /usr/local/lib/python3.7/dist-packages (from fitsne) (0.29.22)
Building wheels for collected packages: fitsne
Building wheel for fitsne (setup.py) ... error
ERROR: Failed building wheel for fitsne
Running setup.py clean for fitsne
Failed to build fitsne
Installing collected packages: fitsne
Running setup.py install for fitsne ... error
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ezkx1s2e/fitsne/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ezkx1s2e/fitsne/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-uzkyz06_/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
Can someone please explain how to fix such an error in colab?
I solved it using this gist
!git clone https://github.com/KlugerLab/FIt-SNE.git
!wget http://www.fftw.org/fftw-3.3.8.tar.gz
!tar -xf fftw-3.3.8.tar.gz
!cd fftw-3.3.8
!./fftw-3.3.8/configure
!make
!make install
!g++ -std=c++11 -O3 FIt-SNE/src/sptree.cpp FIt-SNE/src/tsne.cpp FIt-SNE/src/nbodyfft.cpp -o FIt-SNE/bin/fast_tsne -pthread -lfftw3 -lm -Wno-address-of-packed-member
import sys; sys.path.append('FIt-SNE/')
from fast_tsne import fast_tsne
I'm trying to get install TA-lib, but running into errors I don't understand.
I installed brew, and ran the following:
brew install ta-lib
That seemed to work because if I re-run that, I get a note that
ta-lib 0.4.0 is already installed and up-to-date
However, running pip3 install ta-lib results in the following errors. From googling around, this seems to happen when ta-lib wasn't installed first, but not sure how to address when the initial install seems to go fine.
pip3 install TA-lib
Collecting TA-lib
Using cached TA-Lib-0.4.19.tar.gz (267 kB)
Requirement already satisfied: numpy in /Users/mf/venv/lib/python3.8/site-packages (from TA-lib) (1.19.5)
Using legacy 'setup.py install' for TA-lib, since package 'wheel' is not installed.
Installing collected packages: TA-lib
Running setup.py install for TA-lib ... error
ERROR: Command errored out with exit status 1:
command: /Users/mf/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-install-armqiybl/ta-lib_03c018e0f8f24266a3c6fc47436cf143/setup.py'"'"'; __file__='"'"'/private/var/folders/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-install-armqiybl/ta-lib_03c018e0f8f24266a3c6fc47436cf143/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-record-q2zdmts7/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mf/venv/include/site/python3.8/TA-lib
cwd: /private/var/folders/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-install-armqiybl/ta-lib_03c018e0f8f24266a3c6fc47436cf143/
Complete output (27 lines):
/private/var/folders/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-install-armqiybl/ta-lib_03c018e0f8f24266a3c6fc47436cf143/setup.py:71: UserWarning: Cannot find ta-lib library, installation may fail.
warnings.warn('Cannot find ta-lib library, installation may fail.')
running install
running build
running build_py
creating build
creating build/lib.macosx-10.14.6-x86_64-3.8
creating build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/abstract.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/test_abstract.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/deprecated.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/stream.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/test_pandas.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/test_data.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/test_func.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/test_stream.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
running build_ext
building 'talib._ta_lib' extension
creating build/temp.macosx-10.14.6-x86_64-3.8
creating build/temp.macosx-10.14.6-x86_64-3.8/talib
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/Users/mf/venv/lib/python3.8/site-packages/numpy/core/include -I/Users/mf/venv/include -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c talib/_ta_lib.c -o build/temp.macosx-10.14.6-x86_64-3.8/talib/_ta_lib.o
talib/_ta_lib.c:611:10: fatal error: 'ta-lib/ta_defs.h' file not found
#include "ta-lib/ta_defs.h"
^~~~~~~~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/mf/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-install-armqiybl/ta-lib_03c018e0f8f24266a3c6fc47436cf143/setup.py'"'"'; __file__='"'"'/private/var/folders/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-install-armqiybl/ta-lib_03c018e0f8f24266a3c6fc47436cf143/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-record-q2zdmts7/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mf/venv/include/site/python3.8/TA-lib Check the logs for full command output.
I updated TA_LIBRARY_PATH & TA_INCLUDE_PATH after finding where brew was installing ta-lib, ran the following and pip3 install seemed to work properly, but I wasn't able to actually import it. After trying to re-install ta-lib, I get the same error as above.
export TA_LIBRARY_PATH=/opt/homebrew/opt/ta-lib/lib
export TA_INCLUDE_PATH=/opt/homebrew/opt/ta-lib/include
I tried to install Cryptography through:
lsn#lsn-Super-Server:~/pypy/pypy3-v6.0.0-linux64/bin$ ./pypy3 -m pip install PyMySQL
But, it failed with the comments:
running egg_info
writing src/cryptography.egg-info/PKG-INFO
writing dependency_links to src/cryptography.egg-info/dependency_links.txt
writing requirements to src/cryptography.egg-info/requires.txt
writing top-level names to src/cryptography.egg-info/top_level.txt
reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'docs/_build'
warning: no previously-included files matching '*' found under directory 'vectors'
writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
running build_ext
generating cffi module 'build/temp.linux-x86_64-3.5/_padding.c'
creating build/temp.linux-x86_64-3.5
generating cffi module 'build/temp.linux-x86_64-3.5/_constant_time.c'
generating cffi module 'build/temp.linux-x86_64-3.5/_openssl.c'
building '_openssl' extension
creating build/temp.linux-x86_64-3.5/build
creating build/temp.linux-x86_64-3.5/build/temp.linux-x86_64-3.5
cc -pthread -DNDEBUG -O2 -Qunused-arguments -fPIC -I/home/lsn/pypy/pypy3-v6.0.0-linux64/include -c build/temp.linux-x86_64-3.5/_openssl.c -o build/temp.linux-x86_64-3.5/build/temp.linux-x86_64-3.5/_openssl.o -Wconversion -Wno-error=sign-conversion
cc: error: unrecognized command line option ‘-Qunused-arguments’; did you mean ‘-Wunused-parameter’?
error: command 'cc' failed with exit status 1
----------------------------------------
Command "/home/lsn/pypy/pypy3-v6.0.0-linux64/bin/pypy3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-87db0m7x/Cryptography/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-9zd03ixf/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-87db0m7x/Cryptography/
I faced the same error while installing paypalrestsdk for python3 and I found the solution that needs to install or update python-openssl for that.
Try below commands, it's working for me.
For python2
sudo apt-get install python-openssl
For python3
sudo apt-get install python3-openssl
Hope it works for you too.
I was trying to install pymssql library:
pip install pymssql
It gave the following error:
Collecting pymssql
Downloading https://files.pythonhosted.org/packages/4c/c8/5ad36d8d3c304ab4f310c89d0593ab7b6229568dd8e9cde927311b2f0c00/pymssql-2.1.3.tar.gz (897kB)
100% |████████████████████████████████| 901kB 1.1MB/s
Installing collected packages: pymssql
Running setup.py install for pymssql ... error
Complete output from command /Users/hektor/Sites/venv2/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/rv/vbf7xqh1601_xjkrn85w7hp00000gn/T/pip-install-60za8qcc/pymssql/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/rv/vbf7xqh1601_xjkrn85w7hp00000gn/T/pip-record-vh_omvko/install-record.txt --single-version-externally-managed --compile --install-headers /Users/hektor/Sites/venv2/include/site/python3.5/pymssql:
setup.py: platform.system() => 'Darwin'
setup.py: platform.architecture() => ('64bit', '')
setup.py: platform.libc_ver() => ('', '')
setup.py: Detected Darwin/Mac OS X.
You can install FreeTDS with Homebrew or MacPorts, or by downloading
and compiling it yourself.
Homebrew (http://brew.sh/)
--------------------------
brew install freetds
MacPorts (http://www.macports.org/)
-----------------------------------
sudo port install freetds
setup.py: Not using bundled FreeTDS
setup.py: include_dirs = ['/usr/local/include']
setup.py: library_dirs = ['/usr/local/lib']
running install
running build
running build_ext
building '_mssql' extension
creating build
creating build/temp.macosx-10.11-x86_64-3.5
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/Users/hektor/Sites/venv2/include -I/usr/local/Cellar/python3/3.5.2_1/Frameworks/Python.framework/Versions/3.5/include/python3.5m -c _mssql.c -o build/temp.macosx-10.11-x86_64-3.5/_mssql.o -DMSDBLIB
_mssql.c:266:10: fatal error: 'sqlfront.h' file not found
#include "sqlfront.h"
^~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
As I understand from above that I need to install FreeTDS as indicated in their website
I installed FreeTDS with homebrew:
brew install freetds
After the installation was complete, I tried to run this command again:
pip install pymssql
However I got this error:
-bash: /Users/hektor/Sites/venv2/bin/pip: /Users/hektor/Sites/venv2/bin/python3: bad interpreter: No such file or directory
Additional information:
If I run which python:
/Users/hektor/anaconda2/bin/python
If I run which python3, then nothing returns.
I am using MacOS and my development environment is a virtual environment in my local machine.
How can I fix this problem? I had no such error until I try this pip installation.
I am currently trying to install my own package using the command: pip3 install --user ., which invokes this setup script. However, when I do that, I get the following output:
cherrybomb#cherrybomb:~/cherrybomb$ pip3 install --user .
Processing /home/cherrybomb/cherrybomb
Collecting twisted>=17.9.0 (from cherrybomb==0.1.0)
Collecting pyopenssl>=17.5.0 (from cherrybomb==0.1.0)
Using cached pyOpenSSL-17.5.0-py2.py3-none-any.whl
Collecting wheel>=0.30.0 (from cherrybomb==0.1.0)
Using cached wheel-0.30.0-py2.py3-none-any.whl
Collecting hyperlink>=17.1.1 (from twisted>=17.9.0->cherrybomb==0.1.0)
Using cached hyperlink-17.3.1-py2.py3-none-any.whl
Collecting constantly>=15.1 (from twisted>=17.9.0->cherrybomb==0.1.0)
Using cached constantly-15.1.0-py2.py3-none-any.whl
Collecting Automat>=0.3.0 (from twisted>=17.9.0->cherrybomb==0.1.0)
Using cached Automat-0.6.0-py2.py3-none-any.whl
Collecting incremental>=16.10.1 (from twisted>=17.9.0->cherrybomb==0.1.0)
Using cached incremental-17.5.0-py2.py3-none-any.whl
Collecting zope.interface>=4.0.2 (from twisted>=17.9.0->cherrybomb==0.1.0)
Using cached zope.interface-4.4.3-cp36-cp36m-manylinux1_x86_64.whl
Collecting cryptography>=2.1.4 (from pyopenssl>=17.5.0->cherrybomb==0.1.0)
Using cached cryptography-2.1.4-cp36-cp36m-manylinux1_x86_64.whl
Collecting six>=1.5.2 (from pyopenssl>=17.5.0->cherrybomb==0.1.0)
Using cached six-1.11.0-py2.py3-none-any.whl
Collecting attrs (from Automat>=0.3.0->twisted>=17.9.0->cherrybomb==0.1.0)
Using cached attrs-17.3.0-py2.py3-none-any.whl
Collecting setuptools (from zope.interface>=4.0.2->twisted>=17.9.0->cherrybomb==0.1.0)
Using cached setuptools-38.2.5-py2.py3-none-any.whl
Collecting cffi>=1.7; platform_python_implementation != "PyPy" (from cryptography>=2.1.4->pyopenssl>=17.5.0->cherrybomb==0.1.0)
Using cached cffi-1.11.2-cp36-cp36m-manylinux1_x86_64.whl
Collecting idna>=2.1 (from cryptography>=2.1.4->pyopenssl>=17.5.0->cherrybomb==0.1.0)
Using cached idna-2.6-py2.py3-none-any.whl
Collecting asn1crypto>=0.21.0 (from cryptography>=2.1.4->pyopenssl>=17.5.0->cherrybomb==0.1.0)
Using cached asn1crypto-0.24.0-py2.py3-none-any.whl
Collecting pycparser (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography>=2.1.4->pyopenssl>=17.5.0->cherrybomb==0.1.0)
Installing collected packages: hyperlink, constantly, six, attrs, Automat, incremental, setuptools, zope.interface, twisted, pycparser, cffi, idna, asn1crypto, cryptography, pyopenssl, wheel, cherrybomb
Running setup.py install for cherrybomb ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-8wz3oeu9-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-mxvris8y-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-8wz3oeu9-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-mxvris8y-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code -11 in /tmp/pip-8wz3oeu9-build/
Segmentation fault (core dumped)
cherrybomb#cherrybomb:~/cherrybomb$
I am installing this on ubuntu 17.10 x64:
cherrybomb#cherrybomb:~/cherrybomb$ uname -a
Linux cherrybomb 4.13.0-16-generic #19-Ubuntu SMP Wed Oct 11 18:35:14 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
cherrybomb#cherrybomb:~/cherrybomb$ python3.6 --version
Python 3.6.3
cherrybomb#cherrybomb:~/cherrybomb$
Any insight into what I'm doing wrong would be much appreciated. Thank you and have a great day!
Though this seems to be an old issue I hope leaving a reply here may be of help.
Try with sudo !!. If you weren't inside a virtual environment, maybe you didn't had the necessary privileges to install the packages system wide.