Error when installing cmake for python windows - python

I have windows 10 and fresh Python 3.6.1.
I was trying to install package Cmake 0.6.0 (needed for another package, atari-py) using
pip install cmake
but I'm getting an error.
I have these packages installed: pip,scikit-build, setuptools, wheel, pybdist.
I do have a foreign symbol in my account name (lesson learnt), but it works fine when installing other packages. I am not a skilled windows administrator.
Collecting cmake
Using cached cmake-0.6.0.tar.gz
Building wheels for collected packages: cmake
Running setup.py bdist_wheel for cmake: started
Running setup.py bdist_wheel for cmake: finished with status 'error'
Complete output from command C:\Python\Python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Čejkis\\AppData\\Local\\Temp\\pycharm-packaging1\\cmake\\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\EJKIS~1\AppData\Local\Temp\tmp3br7eri7pip-wheel- --python-tag cp36:
Traceback (most recent call last):
File "C:\Python\Python36-32\lib\site-packages\skbuild\setuptools_wrap.py", line 405, in setup
cmkr = cmaker.CMaker()
File "C:\Python\Python36-32\lib\site-packages\skbuild\cmaker.py", line 67, in __init__
"Problem with the CMake installation, aborting build.")
Problem with the CMake installation, aborting build.
----------------------------------------
Running setup.py clean for cmake
Failed to build cmake
Installing collected packages: cmake
Running setup.py install for cmake: started
Running setup.py install for cmake: finished with status 'error'
Complete output from command C:\Python\Python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Čejkis\\AppData\\Local\\Temp\\pycharm-packaging1\\cmake\\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\EJKIS~1\AppData\Local\Temp\pip-5ql_x35g-record\install-record.txt --single-version-externally-managed --compile:
Traceback (most recent call last):
File "C:\Python\Python36-32\lib\site-packages\skbuild\setuptools_wrap.py", line 405, in setup
cmkr = cmaker.CMaker()
File "C:\Python\Python36-32\lib\site-packages\skbuild\cmaker.py", line 67, in __init__
"Problem with the CMake installation, aborting build.")
Problem with the CMake installation, aborting build.
----------------------------------------
Failed building wheel for cmake
Command "C:\Python\Python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Čejkis\\AppData\\Local\\Temp\\pycharm-packaging1\\cmake\\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\EJKIS~1\AppData\Local\Temp\pip-5ql_x35g-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Čejkis\AppData\Local\Temp\pycharm-packaging1\cmake\

python -m pip install --upgrade pip
and then you can run
pip3 install cmake
This works for me on Pyhton 3.8

if the above answers of pip3 or pip install cmake don't work try
sudo apt-get install cmake

As of today, CMake wheels for python 3.6 are available and pip install cmake is expected to work.
Background
At the time of your first post, there were no wheels for python 3.6, pip was rightfully trying to build the wheel using the source distribution.
Considering that:
the project allowing to generate a CMake wheel itself depends on scikit-build and cmake
we simply repackage the existing binaries into the windows wheels
... you got the general error message Problem with the CMake installation, aborting build.
References:
http://cmake-python-distributions.readthedocs.io
http://scikit-build.readthedocs.io/
Installing atari-py on windows
Looking at the documentation and open pull requests of the corresponding project, it look like windows is not supported. See https://github.com/openai/atari-py
If you would like to help the project and improve their windows support, let me know and I could try to give you some guidance to create a pull request and simplify their build system.

Eventually I installed cmake 0.8 from a binary file from their webpage.
I originally wanted to install package atari-py that needed cmake. I downloaded that from git and in cmd with administrator rights I ran
python install setup.py
which worked.
python setup.py install
still didn't work. Unfortunately I can't give any further explanation.

I just downloaded VS Code with C++ libraries and that did the trick, I was able to install CMake. (I was on Windows 10 btw)

Related

Not able to install turicreate in PyCharm mac OS 10.13 [duplicate]

This question already has answers here:
Error installing Turicreate on ubuntu python 3.8.2 on pip
(2 answers)
Closed 2 years ago.
Hello Last few days i am trying to run one script for creating the Modal for machine learning. but I am not able to install the Turicreate package in Pycharm editor.
I follow these steps to run the script.
Download Python 3.7 in this link:
(https://www.python.org/downloads/)
Download the Pycharm Editor(https://www.jetbrains.com/pycharm/)
After that, I set the project interpreter in latest python3.7 and trying to install turicreate but always I got error.
Collecting turicreate
Using cached https://files.pythonhosted.org/packages/db/54/167837569bcb816b3fe68f003f18d07ab9d5ac31b2b12b8f9b07b1ccc7a4/turicreate-4.2.tar.gz
Building wheels for collected packages: turicreate
Running setup.py bdist_wheel for turicreate: started
Running setup.py bdist_wheel for turicreate: finished with status 'error'
Complete output from command /Users/tikam/MLTikam1/venv/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/rh/qx_0gvzn6kzbqjvvbbh66t080000gn/T/pycharm-packaging1/turicreate/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 /private/var/folders/rh/qx_0gvzn6kzbqjvvbbh66t080000gn/T/pip-wheel-qez5g2v_ --python-tag cp37:
running bdist_wheel
running build
installing to build/bdist.macosx-10.9-x86_64/wheel
running install
==================================================================================
ERROR
If you see this message, pip install did not find an available binary package
for your system. Supported platforms are:
* Linux x86_64 (including WSL on Windows 10).
* macOS 10.12+ x86_64.
* Python 2.7, 3.5, or 3.6.
Other possible causes of this error are:
* Outdated pip version (try `pip install -U pip`).
==================================================================================
Running setup.py clean for turicreate
Failed to build turicreate
Installing collected packages: turicreate
Running setup.py install for turicreate: started
Running setup.py install for turicreate: finished with status 'error'
Complete output from command /Users/tikam/MLTikam1/venv/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/rh/qx_0gvzn6kzbqjvvbbh66t080000gn/T/pycharm-packaging1/turicreate/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/rh/qx_0gvzn6kzbqjvvbbh66t080000gn/T/pip-record-kjt0p8as/install-record.txt --single-version-externally-managed --compile --install-headers /Users/tikam/MLTikam1/venv/include/site/python3.7/turicreate:
running install
==================================================================================
ERROR
If you see this message, pip install did not find an available binary package
for your system. Supported platforms are:
* Linux x86_64 (including WSL on Windows 10).
* macOS 10.12+ x86_64.
* Python 2.7, 3.5, or 3.6.
Other possible causes of this error are:
* Outdated pip version (try `pip install -U pip`).
==================================================================================
----------------------------------------
Failed building wheel for turicreate
Command "/Users/tikam/MLTikam1/venv/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/rh/qx_0gvzn6kzbqjvvbbh66t080000gn/T/pycharm-packaging1/turicreate/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/rh/qx_0gvzn6kzbqjvvbbh66t080000gn/T/pip-record-kjt0p8as/install-record.txt --single-version-externally-managed --compile --install-headers /Users/tikam/MLTikam1/venv/include/site/python3.7/turicreate" failed with error code 1 in /private/var/folders/rh/qx_0gvzn6kzbqjvvbbh66t080000gn/T/pycharm-packaging1/turicreate/
Please suggest what step i need to follow to install the turicreat package.
I want to run this script:
Script **************
import turicreate as tc
data = tc.SFrame('photoLabel.sframe')
model = tc.image_classifier.create(data, target='photoLabel')
predictions = model.predict(data)
model.export_coreml('MyClassifier.mlmodel')
It is not supported Python 3.7 right now. So you have to return to the previous Python version.
brew unlink python
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb
Source:https://github.com/apple/turicreate/issues/788
Or you can create virtual env to run turicreate on
Download the Python3.6 tgz file from the official website (eg. Python-3.6.6.tgz)
Unpack it with tar -xvzf Python-3.6.6.tgz
cd Python-3.6.6
run ./configure
run make altinstall to install it
(install vs altinstall explanation here Difference in details between "make install" and "make altinstall")
You'll normally find your new python install under /usr/local/bin. Now you can create a new virtualenv specifying the python version with:
virtualenv --python=python3.6 env3.6
Get into the virtualenv running the command source env3.6/source/bin/activate.
Install turicreate with the classic pip install turicreate
source:https://github.com/tensorflow/tensorflow/issues/17022

"Microsoft Visual C++ … is required" error when trying to install pyodbc on Windows

I am trying to install pyodbc, and I am getting the below error.
C:\Python\Python37\Scripts>pip3 install pyodbc
Output
Collecting pyodbc
Using cached https://files.pythonhosted.org/packages/aa/71/cef225c4889620a1a00251d24c1746fe0cf4124290a75d1c2dc5c187b61f/pyodbc-4.0.23.tar.gz
Installing collected packages: pyodbc
Running setup.py install for pyodbc ... error
Complete output from command c:\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Alankar\\AppData\\Local\\Temp\\pip-install-7qf14pkz\\pyodbc\\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\Alankar\AppData\Local\Temp\pip-record-k11gmg0x\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'pyodbc' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
Command "c:\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Alankar\\AppData\\Local\\Temp\\pip-install-7qf14pkz\\pyodbc\\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\Alankar\AppData\Local\Temp\pip-record-k11gmg0x\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Alankar\AppData\Local\Temp\pip-install-7qf14pkz\pyodbc\
I couldn't get the C++ build tools method to work, but I found this method to be very straightforward:
Download the relevant pyodbc wheel (pre-compiled binary) based on your computer's architecture and version of Python: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyodbc
Run pip install <wheel path>.
For example:
pip install c:\users\bob\downloads\pyodbc-4.0.27-cp38-cp38-win_amd64.whl
Some Libraries require C++ build tools to install. In your case, to solve this problem there are two methods which are:
Update the pip's Setup tool:
To fix your error update the setup tool by this command:
pip install --upgrade setuptools
And the second method is to:
Install the Microsoft Visual C++ Build Tools
This can also be fixed by installing this little tool provided by Microsoft:
https://visualstudio.microsoft.com/visual-cpp-build-tools/
the install failed on my machine even after I installed Microsoft VC++ build tools, my solution for this is install an early version. the newer version assume you have VC++ and VS 2019 installed.
run this command
pip install -Iv pyodbc==4.0.27
If none of the other answers work:
I was running the newest version of python and it was giving me this error.
As soon as I downgraded to 3.8.x it worked like a charm using pip install

Pip install error (Pyside to Raspberry Pi)

I'm trying to pip install pyside to my Raspberry Pi and receive the following error:
pi#raspberrypi:/ $ sudo pip install pyside
Collecting pyside
Using cached https://files.pythonhosted.org/packages/36/ac/ca31db6f2225844d37a41b10615c3d371587677efd074db29855e7035de6/PySide-1.2.4.tar.gz
Building wheels for collected packages: pyside
Running setup.py bdist_wheel for pyside ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-TXwQwt/pyside/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 /tmp/tmps80BMupip-wheel- --python-tag cp27:
Removing /tmp/pip-build-TXwQwt/pyside/pyside_package
running bdist_wheel
running build
Python architecture is 32bit
error: Failed to find cmake. Please specify the path to cmake with --cmake parameter.
----------------------------------------
Failed building wheel for pyside
Running setup.py clean for pyside
Failed to build pyside
Installing collected packages: pyside
Running setup.py install for pyside ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-TXwQwt/pyside/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-5BdNE7-record/install-record.txt --single-version-externally-managed --compile:
Removing /tmp/pip-build-TXwQwt/pyside/pyside_package
running install
running build
Python architecture is 32bit
error: Failed to find cmake. Please specify the path to cmake with --cmake parameter.
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-TXwQwt/pyside/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-5BdNE7-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-TXwQwt/pyside/
pi#raspberrypi:/ $
I've tried fixing it with sudo pip install setuptools --no-use-wheel --upgrade, sudo apt install -y libmysqlclient-dev, python setup.py install, and sudo pip install --upgrade setuptools but none have worked to allow me to install Pyside. Any help would be much appreciated. Thank you.
I'm running Raspbian Stretch on a raspberry pi 3 if that matters.
You can try precompiled wheels from https://www.piwheels.org/
There are no pyside binary wheels for Pi so you need to install a lot of prerequisites and compiles from sources:
sudo apt-get install build-essential git cmake libqt4-dev libphonon-dev python2.7-dev libxml2-dev libxslt1-dev qtmobility-dev libqtwebkit-dev
which python version you are using, since this module supports only below listed version.
[(2.6), (2.7), (3.2), (3.3), (3.4)]
It looks self explanatory.
You are installing the module on an unsupported version of python.
try installing with pip2 install pyside

"pip install jq" generates errors on Mac and Windows

Duplicate of this issue, but the first answer there is wrong (jq is supported on Windows) and the second refers to brew so I'm guessing is for Mac.
Windows
I am trying to install jq for python from the Windows command line, but get the following errors, possibly due to a missing temp\pip-build-rtnhmg\jq\onig-install-5.9.6 file:
error: [Error 2] The system cannot find the file specified
... and ...
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\<USERNAME>\\appdata\\local\\temp\\pip-build-rtnhmg\\jq\\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\<USERNAME>\appdata\local\temp\pip-khvjht-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\<USERNAME>\appdata\local\temp\pip-build-rtnhmg\jq\
Does anyone know what's gone wrong here? Searches on StackOverflow and Google aren't giving me much to go on, and I'm not great with Windows and still new to python/pip.
Here is the full text, minus username:
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>pip install jq
Collecting jq
Using cached jq-0.1.6.tar.gz
Building wheels for collected packages: jq
Running setup.py bdist_wheel for jq ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\<USERNAME>\\appdata\\local\\temp\\pip-build-rtnhmg\\jq\\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\<USERNAME>\appdata\local\temp\tmpuvrf_upip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_ext
Executing: ./configure CFLAGS=-fPIC --prefix=c:\users\<USERNAME>\appdata\local\temp\pip-build-rtnhmg\jq\onig-install-5.9.6
error: [Error 2] The system cannot find the file specified
----------------------------------------
Failed building wheel for jq
Running setup.py clean for jq
Failed to build jq
Installing collected packages: jq
Running setup.py install for jq ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\<USERNAME>\\appdata\\local\\temp\\pip-build-rtnhmg\\jq\\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\<USERNAME>\appdata\local\temp\pip-khvjht-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
Executing: ./configure CFLAGS=-fPIC --prefix=c:\users\<USERNAME>\appdata\local\temp\pip-build-rtnhmg\jq\onig-install-5.9.6
error: [Error 2] The system cannot find the file specified
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\<USERNAME>\\appdata\\local\\temp\\pip-build-rtnhmg\\jq\\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\<USERNAME>\appdata\local\temp\pip-khvjht-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\<USERNAME>\appdata\local\temp\pip-build-rtnhmg\jq\
Trying to install pyjq instead generates the same errors.
I'm not married to jq: I just need to format json data in python, and jq does a great job on the command line. If there are other python packages I should try instead, please feel free to recommend them. As mentioned above though, pyjq is failing install with the same errors.
Further details / steps taken:
I am on Windows 10 and have installed python 2.7.13, setuptools and pip using the steps from here ... no issues noted.
Using pip, I have successfully installed other python packages such as request and jira ... no issues noted.
Using chocolatey I have successfully installed jq for the command line, following these steps ... no issues noted.
I have tried using regular permissions, running cmd as administrator, starting a new cmd session, restarting the PC - but get the same errors.
Trying to install pyjq (pip install pyjq) generates the same errors.
Tried pip install jq on a Mac and got similar errors:
Command "/usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/v5/4x0py0ns2td1h69vgllx7dpr0000gn/T/pip-build-DyMoT4/jq/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/v5/4x0py0ns2td1h69vgllx7dpr0000gn/T/pip-i6UKvt-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/v5/4x0py0ns2td1h69vgllx7dpr0000gn/T/pip-build-DyMoT4/jq/
for the Mac, followed the steps suggested from here and successfully installed setuptools as suggested, but pip install jq still fails with the same error.
Installing via pip
As per jq installation steps for pip's project:
Installation requires any programs required to build jq. This includes:
Autoreconf
The normal C compiler toolchain, such as gcc and make.
libtool
Python headers.
macOS
On macOS, you need XCode to be installed, and the following packages:
brew install autoconf automake libtool
brew install jq
Linux
You need the following packages to be installed:
yum install autoconf automake libtool python

python command pip install pillow in windows getting error

building 'PIL._imaging' extension
error: [WinError 2] The system cannot find the file specified
----------------------------------------
Failed building wheel for Pillow
Failed to build Pillow
Installing collected packages: Pillow
Running setup.py install for Pillow
Complete output from command c:\users\anilkumar.vandrangi\desktop\aspire\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\ANILKU~1.VAN\\AppData\\Local\\Temp\\pip-build-tr4denzb\\Pil
low\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\ANILKU~1.VAN\AppData\Local\Temp\pip-7zffvlgz-record\in
stall-record.txt --single-version-externally-managed --compile:
Single threaded build, not installing mp_compile: 4 processes
running install
running build
running build_py
running egg_info
writing top-level names to Pillow.egg-info\top_level.txt
writing Pillow.egg-info\PKG-INFO
writing dependency_links to Pillow.egg-info\dependency_links.txt
warning: manifest_maker: standard file '-c' not found
reading manifest file 'Pillow.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'Pillow.egg-info\SOURCES.txt'
running build_ext
building 'PIL._imaging' extension
error: [WinError 2] The system cannot find the file specified
----------------------------------------
Command "c:\users\anilkumar.vandrangi\desktop\aspire\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\ANILKU~1.VAN\\AppData\\Local\\Temp\\pip-build-tr4denzb\\Pillow\\setup.py';exec(comp
ile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\ANILKU~1.VAN\AppData\Local\Temp\pip-7zffvlgz-record\install-record.txt --singl
e-version-externally-managed --compile" failed with error code 1 in C:\Users\ANILKU~1.VAN\AppData\Local\Temp\pip-build-tr4denzb\Pillow
I'm assuming that you have are on x64 bit Windows.
The cleanes way to solve it:
If you have installed 32 bit version of python: uninstall it
install 64 bit
During setup choose to add python to path
Download 64 bit version of pillow:
http://wp.stolaf.edu/it/installing-pil-pillow-cimage-on-windows-and-mac/
Run the setup file.
Check your Pip version to see if you have the last version available.
C:\ python3 -m pip install --version
You can either use python or python3, I used python3 because I have 2.7 and 3.5 on the same disk.
If your version is not the latest update with:
C:\ python3 -m pip install --upgrade pip
Then now try pip install Pillow again:
C:\ python3 -m pip install Pillow
This time it has to work without problems.
You're getting this error because the pillow version you're trying to install is incompatible with your python version.
Try upgrading both as a final resort.

Categories

Resources