Unable to install SimpleITK library - python

I am installing using following command:
python -m pip install SimpleITK
I got an error using CMake. The error message is given below:
CMake Error at /usr/share/cmake-3.10/Modules/ExternalData.cmake:1121 (message): Object MD5=890c808122bd90f398e6bc40ec862102 not found
The complete traceback is given as:
Traceback:
Traceback (most recent call last):
File "/home/ipcv-lab/.local/lib/python2.7/site-packages/skbuild/setuptools_wrap.py", line 589, in setup
cmkr.make(make_args, env=env)
File "/home/ipcv-lab/.local/lib/python2.7/site-packages/skbuild/cmaker.py", line 507, in make
os.path.abspath(CMAKE_BUILD_DIR())))
An error occurred while building with CMake.
Command:
cmake --build . --target install --config Release --
Source directory:
/tmp/pip-build-cUCNSY/SimpleITK
Working directory:
/tmp/pip-build-cUCNSY/SimpleITK/_skbuild/linux-aarch64-2.7/cmake-build
Please see CMake's output for more information.
I have tried installing with conda as well, but I am getting an error of unavailable channels

It looks like cmake is trying to compile SimpleITK. Not sure why it needs to do that for a pip install.
You could try downloading the Python wheel for SimpleITK directly and installing the wheel. Here's where you can download the package:
https://pypi.org/project/SimpleITK/#files
Also it looks like you're using Python 2.7. SimpleITK isn't supported on 2.7. You're going to have to use 3.5 or up.
As far as conda goes, did you use the "-c condo-forge" option to select the proper channel to download SimpleITK?

Related

can not install specific version of nltk

for a specific reason I need to install nltk 2.09b in python 2.7 version. But whenever I execute the following command,
pip2 install nltk==2.0b9
I get the following error:
Collecting nltk==2.0b9
Using cached https://files.pythonhosted.org/packages/ea/b3/4c5157bf034437905fbbd3c80e58c8b4a22cf3400db0bdf19dae3079a732/nltk-2.0b9.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: '/private/var/folders/3b/yskb8jks10lf_pqvv1sy7v740000gn/T/pip-install-63jdDZ/nltk/setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/3b/yskb8jks10lf_pqvv1sy7v740000gn/T/pip-install-63jdDZ/nltk/
But if I run without any version specification I don't get an error. like the following:
pip2 install nltk;
How can I solve this issue?
First thing: using anaconda, you probably have a recent enough pip and setuptools and should use conda itself to update those. With anaconda, conda install is the primary resource for installing anaconda-provided packages. Then, "2.0b9" is a beta release (as indicated by the "b9") and might suffer from a configuration problem for the install. The setup.py file is not located at the root of the downloaded archive file, I suppose that creates the problem.
Use this
pip3.6 install nltk==version

FileNotFoundError Installing PyQt5

I'm been trying to install PyQt and I can't get past the below error. I've read a few posts suggesting that I should upgrade PIP, setup_tools, and ez_install. I've tried all of that with no luck. Any tips?
c:\Python27>pip install PyQt5_gpl-5.10.tar.gz
Processing c:\python27\pyqt5_gpl-5.10.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\program files (x86)\python36-32\lib\tokenize.py", line 452, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\JAME~1.KRK\\AppData\\Local\\Temp\\pip-0u8uht47-build\\setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\JAME~1.KRK\AppData\Local\Temp\pip-0u8uht47-build\
Same thing in 3.6:
c:\Program Files (x86)\Python36-32>pip install PyQt5_gpl-5.10.tar.gz
Processing c:\program files (x86)\python36-32\pyqt5_gpl-5.10.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\program files (x86)\python36-32\lib\tokenize.py", line 452, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\JAME~1.KRK\\AppData\\Local\\Temp\\pip-f9s0_6sp-build\\setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\JAM~1.KRK\AppData\Local\Temp\pip-f9s0_6sp-build\
I just encountered the same issue and find clue in the topic. It has been solved by pip upgrade.
Here is the detail:
1. Issue case:
pip3 install pyqt5.
failed and report FileNotFoundError: [Errno 2] No such file or directory:
2. OS environment:
Win10 64x WSL2
3. Python environment
python 3.7.3
pip version 19.X (not write down)
Solved steps:
pip3 install --upgrade pip
pip3 install --user PyQt5
sudo apt-get update -y
sudo apt install libgl1-mesa-glx -y
now. It works.
Root cause:
a. pyqt
in wsl, pip old version download wrong package.
pip (v20.x) download below version
PyQt5-5.15.2-5.15.2-cp35.cp36.cp37.cp38.cp39-abi3-manylinux2014_x86_64.whl
b. libgl1.so1.
not such lib need install by apt intall
Hope my experience can help you.
On PyPI it seems PyQT5 is for python 3.5 or higher only. Not python 2.7. Use an earlier version of PyQt or a newer version of python (Python 2.7 isn't supported beyond 2020, you'll need to move sooner or later).
You appear to be trying to make pip install the PyQt5 source archive. PyQt doesn't use the usual setup.py script that many python packages use and cannot be built and installed from source with pip. Furthermore, the .tar.gz format is intended for linux systems and Windows provides no native support. I am not sure whether pip on Windows would even handle the format. There is a .zip version provided for Windows users.
You need to either extract the archive and build from source, or allow pip to download and install the package itself with pip install PyQt5.
If you are using Python < 3.5, you will have to build from source (or install PyQt4 instead), as there are no official builds provided for these versions of Python. For everything else the pip command above should be enough.
you need to use Python >= 3.5 or try the older PyQt4
on debianoids there is a nice way out of this bug
apt install python3-pyqt5

XGBoost installation failing

I'm trying to install XGBoost on my AWS Ubuntu machine.
I followed the instructions and installed GCC and cmake. However, when I write
pip install xgboost
I get the following error
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-sorzhu8y/xgboost/setup.py", line 29, in <module>
LIB_PATH = libpath['find_lib_path']()
File "/tmp/pip-build-sorzhu8y/xgboost/xgboost/libpath.py", line 45, in find_lib_path
'List of candidates:\n' + ('\n'.join(dll_path)))
XGBoostLibraryNotFound: Cannot find XGBoost Libarary in the candicate path, did you install compilers and run build.sh in root path?
List of candidates:
/tmp/pip-build-sorzhu8y/xgboost/xgboost/libxgboost.so
/tmp/pip-build-sorzhu8y/xgboost/xgboost/../../lib/libxgboost.so
/tmp/pip-build-sorzhu8y/xgboost/xgboost/./lib/libxgboost.so
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-sorzhu8y/xgboost/
Any ideas what could be causing this?
According to python documentation:
This module makes available standard errno system symbols. The value
of each symbol is the corresponding integer value. The names and
descriptions are borrowed from linux/include/errno.h, which should be
pretty all-inclusive.
So Error code 1 is defined in errno.h and means Operation not permitted.
Your setuptools do not appear to be installed.
So, try to upgrade python tools
pip install --upgrade setuptools
If it's already up to date, check that the module ez_setup is not missing. If it is, then
pip install ez_setup
Then try again
pip install unroll
If it's still not working, maybe pip didn't install/upgrade setup_tools properly so you might want to try
easy_install -U setuptools
and again
pip install unroll
for me was resolved after upgrading pip
let us know about you..
There are instruction in the site: http://xgboost.readthedocs.io/en/latest/build.html
First:
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost
make -j4
Then:
cd python-package
sudo python setup.py install

Installing bsddb3 6.1.1 in Windows: FileNotFoundError: 'db/include\\db.h'

I'm running Windows 7 x64, with Python 3.4. When I run pip install bsddb3 I get:
λ pip install bsddb3
Collecting bsddb3
Using cached bsddb3-6.1.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "C:\Users\User\AppData\Local\Temp\pip-build-soqf0_qb\bsddb3\setup.py", line 42, in <module>
import setup3
File "C:\Users\User\AppData\Local\Temp\pip-build-soqf0_qb\bsddb3\setup3.py", line 375, in <module>
with open(os.path.join(incdir, 'db.h'), 'r') as f :
FileNotFoundError: [Errno 2] No such file or directory: 'db/include\\db.h'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\User\AppData\Local\Temp\pip-build-soqf0_qb\bsddb3
So I tried downloading the sources for bsddb3. I made sure I had the BSD DB Windows binaries from Oracle installed; I downloaded them from Berkeley DB 6.1.26.msi. Moving the include and lib directories from the DB install to a /db directory in the bsddb3 folder fixed the problem of not being able to find the libraries. But then the setup failed on a missing variable that's in the posix section but not properly declared in the Windows section.
Fixing that, and a couple of other adjustments, and python setup.py build actually ran the build, but after a bunch of warnings about unsafe conversions it failed with an error:
warning: I don't know what to do with 'runtime_library_dirs': ['db/lib']
error: don't know how to set runtime library search path for MSVC++
I'm not sure what to do next. Other than rewrite the library I was originally trying to use so that it uses SQLAlchemy instead or something.
One don't really want to spend couple of nights compiling that on Windows, so the best option is to use pre-built binary from Unofficial Windows Binaries for Python Extension Packages.
Download the package for your Python version (cpXX part of the name) and architecture (win_amd64 or win32), like bsddb3-6.1.1-cp34-none-win_amd64.whl, and install it with pip:
pip install bsddb3-6.1.1-cp34-none-win_amd64.whl
Based on cyberj0g's answer.
https://www.lfd.uci.edu/~gohlke/pythonlibs/#bsddb3
pip install bsddb3-6.1.1-cp34-none-win_amd64.whl
Note: the cp part is corresponding to the CPython version.
which means cp36 is for CPython 3.6.And divided into 32-bit and 64-bit versions for windows
bsddb3‑6.2.5‑cp36‑cp36m‑win32.whl
bsddb3‑6.2.5‑cp36‑cp36m‑win_amd64.whl

pip install django-mongodb-engine Error: "Command "python setup.py egg_info" failed with error code 1"

i hope someone here can help me cause iam really struggling with this for about 12 hours+.
I try to use Django with MongoDb Using the following Instruction for the packages http://docs.mongodb.org/manual/tutorial/write-a-tumblelog-application-with-django-mongodb-engine/
which want me to install
pip install ***ps://bitbucket.org/wkornewald/django-nonrel/get/tip.tar.gz
pip install ***ps://bitbucket.org/wkornewald/djangotoolbox/get/tip.tar.gz
pip install ***ps://github.com/django-nonrel/mongodb-engine/tarball/master
I managed the first 2, however I get the following errors when I try to install the mongodb-engine.
I tried various forms to install it like "pip install django-mongodb-engine"
I get the following error:
"C:\Users\Burnie\Anaconda3\Scripts>pip install django-mongodb-engine
Collecting django-mongodb-engine
Using cached django-mongodb-engine-0.6.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 20, in
File "C:\Users\Burnie\AppData\Local\Temp\pip-build-ntl4z4sp\django-mongodb-engine\setup.py", line 3, in
import django_mongodb_engine as distmeta
File "C:\Users\Burnie\AppData\Local\Temp\pip-build-ntl4z4sp\django-mongodb-engine\django_mongodb_engine__init__.py", line 12,
in
from django.conf import settings
File "C:\Users\Burnie\Anaconda3\lib\site-packages\django\conf__init__.py", line 88
except ImportError, e:
^
SyntaxError: invalid syntax
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Burnie\AppData\Local\Temp\pip-build-ntl4z4sp\django-mongodb-
engine"
MySystem:
Windows 7,
Anaconda (as python distribution) 64bit
I hope someone can help me on that.
The bitbucket versions of the code are pretty old now. You should use the ones on github instead.
pip install https://github.com/django-nonrel/django/tarball/master
pip install https://github.com/django-nonrel/mongodb-engine/tarball/master
pip install https://github.com/django-nonrel/djangotoolbox/tarball/master
There's also some more up to date instructions on getting this working available in the mongodb-engine documentation

Categories

Resources