pip install on mac runs into version error - python

I'm trying to install a python package with pip, but it thinks I have a different Mac version than I actually do:
pip install root_numpy
Collecting root-numpy
Using cached root_numpy-4.4.1.tar.gz
Building wheels for collected packages: root-numpy
Running setup.py bdist_wheel for root-numpy ... error
Complete output from command /Users/mattzhang/py3_kernel/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/38/2_qkncsd1hlgd2871lnmrgw80000gn/T/pip-build-xexox4xy/root-numpy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /var/folders/38/2_qkncsd1hlgd2871lnmrgw80000gn/T/tmpawn1rjqlpip-wheel- --python-tag cp35:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.6-intel-3.5
creating build/lib.macosx-10.6-intel-3.5/root_numpy
copying root_numpy/__init__.py -> build/lib.macosx-10.6-intel-3.5/root_numpy
copying root_numpy/_array.py -> build/lib.macosx-10.6-intel-3.5/root_numpy
...
clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)
The issue here is that I'm using Yosemite version 10.10.5, but pip thinks I'm using 10.6. What can I do to correct this?

Try to set deployment target
export MACOSX_DEPLOYMENT_TARGET=10.10 and then again do pip install root_numpy.

Related

Can't install dev-setup of hyperledger indy-node

I am trying to install dev-setup on my system using this link
https://github.com/hyperledger/indy-node/blob/master/docs/source/setup-dev.md
as guide i followed all steps now while executing command pip install -e .[tests] I getting error: failed to build wheels for leveldb, ujson, python-rocksdb, sha3, psutil, orderedset..
I tried python3 setup.py bdist_wheel this command executes but then i am not able to run next command
Building wheels for collected packages: leveldb, ujson, python-rocksdb, sha3, psutil, orderedset
Building wheel for leveldb (setup.py) ... error
ERROR: Complete output from command /home/richa/test/bin/python3.5 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-cwvzh10g/leveldb/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/pip-wheel-ufgtvm7j --python-tag cp35:
ERROR: running bdist_wheel
Steps that are easy to miss in that guide include:
Activating the virtual environment with source activate
Installing wheel with pip install wheel

Python can't install Box2D swig.exe failed with error code 1

I try to install Box2D on python but I get the error log:
C:\>pip3 install Box2D
Collecting Box2D
Using cached https://files.pythonhosted.org/packages/cc/7b/ddb96fea1fa5b24f8929714ef483f64c33e9649e7aae066e5f5023ea426a/Box2D-2.3.2.tar.gz
Building wheels for collected packages: Box2D
Running setup.py bdist_wheel for Box2D ... error
Complete output from command c:\users\hp-laptop\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\HP-LAP~1\\AppData\\Local\\Temp\\pip-install-r48_7g5v\\Box2D\\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\HP-LAP~1\AppData\Local\Temp\pip-wheel-d2ghuwrx --python-tag cp36:
Using setuptools (version 40.5.0).
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\Box2D
copying library\Box2D\Box2D.py -> build\lib.win-amd64-3.6\Box2D
copying library\Box2D\__init__.py -> build\lib.win-amd64-3.6\Box2D
creating build\lib.win-amd64-3.6\Box2D\b2
copying library\Box2D\b2\__init__.py -> build\lib.win-amd64-3.6\Box2D\b2
running build_ext
building 'Box2D._Box2D' extension
swigging Box2D\Box2D.i to Box2D\Box2D_wrap.cpp
C:\Users\HP-Laptop\AppData\Local\Programs\Python\Python36\swig.exe -python -c++ -IBox2D -small -O -includeall -ignoremissing -w201 -globals b2Globals -outdir library\Box2D -keyword -w511 -D_SWIG_KWARGS -o Box2D\Box2D_wrap.cpp Box2D\Box2D.i
C:\Users\HP-Laptop\AppData\Local\Programs\Python\Python36\Lib\pyprimtypes.swg(7) : Error: Syntax error in input(1).
error: command 'C:\\Users\\HP-Laptop\\AppData\\Local\\Programs\\Python\\Python36\\swig.exe' failed with exit status 1
----------------------------------------
Failed building wheel for Box2D
Running setup.py clean for Box2D
Failed to build Box2D
Installing collected packages: Box2D
Running setup.py install for Box2D ... error
Complete output from command c:\users\hp-laptop\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\HP-LAP~1\\AppData\\Local\\Temp\\pip-install-r48_7g5v\\Box2D\\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\HP-LAP~1\AppData\Local\Temp\pip-record-nv5dm4ru\install-record.txt --single-version-externally-managed --compile:
Using setuptools (version 40.5.0).
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\Box2D
copying library\Box2D\Box2D.py -> build\lib.win-amd64-3.6\Box2D
copying library\Box2D\__init__.py -> build\lib.win-amd64-3.6\Box2D
creating build\lib.win-amd64-3.6\Box2D\b2
copying library\Box2D\b2\__init__.py -> build\lib.win-amd64-3.6\Box2D\b2
running build_ext
building 'Box2D._Box2D' extension
swigging Box2D\Box2D.i to Box2D\Box2D_wrap.cpp
C:\Users\HP-Laptop\AppData\Local\Programs\Python\Python36\swig.exe -python -c++ -IBox2D -small -O -includeall -ignoremissing -w201 -globals b2Globals -outdir library\Box2D -keyword -w511 -D_SWIG_KWARGS -o Box2D\Box2D_wrap.cpp Box2D\Box2D.i
C:\Users\HP-Laptop\AppData\Local\Programs\Python\Python36\Lib\pyprimtypes.swg(7) : Error: Syntax error in input(1).
error: command 'C:\\Users\\HP-Laptop\\AppData\\Local\\Programs\\Python\\Python36\\swig.exe' failed with exit status 1
----------------------------------------
Command "c:\users\hp-laptop\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\HP-LAP~1\\AppData\\Local\\Temp\\pip-install-r48_7g5v\\Box2D\\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\HP-LAP~1\AppData\Local\Temp\pip-record-nv5dm4ru\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\HP-LAP~1\AppData\Local\Temp\pip-install-r48_7g5v\Box2D\
I tried all solutions for windows from Installing pocketsphinx python module: command 'swig.exe' failed without result.
How can I install Box2D and what means error code 1 by swig ?
I got the same error for Box2D, but solved as follows.
I am using Anaconda environment with python3.6.
try these.
conda install swig
pip install box2d
download swig here : http://www.swig.org/download.html
Extract the archive somewhere, add the path of the extracted directory to your PATH environment variable.
Restart your cmd console window (close it and reopen it), do your pip install Box2D
I need to say that when on the anaconda environment, just add path, it also doesn't work. we need to go on the Scripts with pip.exe. And run the command!
I got same error for Box2D.
My Solution-
downloading Microsoft Visual C++ Compiler for Python 2.7 from http://aka.ms/vcpython27
Complete the installation.
Then on anaconda prompt
type command 'pip install Box2D'
Then type 'pip install gym[all]'
This will install the remaining dependencies.
Hope this helps you.
Hello there I must be late but I hope this helps someone to solve his problem.
Just use any package manager like choco or conda or any other package manager to install the swig package to your machine then run the command to install box2d again.
choco install swig
pip install box2d-py
Whoever is on Windows and facing this issue. Try installing C++ tools on windows through https://visualstudio.microsoft.com/visual-cpp-build-tools/.
Then Install C++ tools through visual studio. This should solve your problem
Try Install Box2D after this (make sure Swig is installed)

Error when installing dlib on Python 3.5 using Windows 10

EDIT: Looks like I have to install Visual Studio 2015...Can I install dlib without VS 2015? I already have older versions pre-installed with Windows.
I am using Python 3.5, trying to install dlib on PyCharm in the terminal and this is what I am getting, and every search on these errors I do... I find stuff on Visual Studio which I don't have the GUI + I don't have vcvarsall.bat in the VC folder of any of the Visual Studio versions (8, 11, 12, 14). I have searched a good amount before posting this question on the Web.
Do I need to download Visual Studio latest version to get vcvarsall.bat ?
This is CMakeLists.txt:
cmake_minimum_required(VERSION ${CMAKE_VERSION})
project(IntelFortranImplicit Fortran)
add_custom_command(
OUTPUT output.cmake
COMMAND ${CMAKE_COMMAND} -P ${IntelFortranImplicit_SOURCE_DIR}/detect.cmake
)
add_library(FortranLib hello.f output.cmake)
This is the error when I do: pip install dlib
Collecting dlib
Using cached dlib-19.6.1.tar.gz
Building wheels for collected packages: dlib
Running setup.py bdist_wheel for dlib ... error
Complete output from command C:\Users\tiger\Anaconda3\envs\TensorFlowExample\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\tiger\\AppDat
a\\Local\\Temp\\pip-build-gjtgkl6a\\dlib\\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\tiger\AppData\Local\Temp\tmprc21rnv_pip-wheel- --python-tag cp35:
running bdist_wheel
running build
error: Cannot find cmake, ensure it is installed and in the path.
You can install cmake using the instructions at https://cmake.org/install/
You can also specify its path with --cmake parameter.
----------------------------------------
Failed building wheel for dlib
Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib
Running setup.py install for dlib ... error
Complete output from command C:\Users\tiger\Anaconda3\envs\TensorFlowExample\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\tiger\\AppD
ata\\Local\\Temp\\pip-build-gjtgkl6a\\dlib\\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\tiger\AppData\Local\Temp\pip-dk1naa28-record\install-record.txt --single-version-externally-managed --compile
:
running install
running build
error: Cannot find cmake, ensure it is installed and in the path.
You can install cmake using the instructions at https://cmake.org/install/
You can also specify its path with --cmake parameter.
----------------------------------------
Command "C:\Users\tiger\Anaconda3\envs\TensorFlowExample\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\tiger\\AppData\\Local\\Temp\\pip-bu
ild-gjtgkl6a\\dlib\\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\tiger\AppData\Local\Temp\pip-dk1naa28-record\install-record.txt --single-version-externally-managed --compile" failed with error code
1 in C:\Users\tiger\AppData\Local\Temp\pip-build-gjtgkl6a\dlib\
Solution found here: Using Anaconda installing manager..!
Running the following in PyCharm Terminal: conda install -c conda-forge dlib=19.4
I was able to use dlib! :)
Huge thanks to birryree in the comments for letting me know!
Open Anaconda Prompt in Administrative mode.
conda update conda 3. conda update anaconda
conda create -n dlib_env python=3.7
conda activate dlib_env
conda install -c conda-forge dlib
python
7.1 >>> import dlib 7.2 >>> dlib.version
Source

"pip install" permission denied on Mac

I tried to install the base65536 module, by typing this into Terminal:
pip install base65536
Yet it produced this error:
Collecting base65536
Using cached base65536-0.1.1.tar.gz
Requirement already satisfied: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from base65536)
Installing collected packages: base65536
Running setup.py install for base65536 ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/2h/n5zk2_w50273k4hdxw8l05240000gn/T/pip-build-tl_DyR/base65536/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/2h/n5zk2_w50273k4hdxw8l05240000gn/T/pip-ZZqmm6-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/base65536
copying base65536/about.py -> build/lib/base65536
copying base65536/init.py -> build/lib/base65536
copying base65536/core.py -> build/lib/base65536
running install_lib
creating /Library/Python/2.7/site-packages/base65536
error: could not create '/Library/Python/2.7/site-packages/base65536': Permission denied
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/2h/n5zk2_w50273k4hdxw8l05240000gn/T/pip-build-tl_DyR/base65536/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/2h/n5zk2_w50273k4hdxw8l05240000gn/T/pip-ZZqmm6-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/2h/n5zk2_w50273k4hdxw8l05240000gn/T/pip-build-tl_DyR/base65536/
How can I fix this?
Thats because you dont have admin permissions.
try this
sudo pip install base65536
When it says Permission Denied that means that you are not an administrator on your computer and therefore cannot do this. Try running as administrator. If you are using windows, right click on app and select 'Run as Administrator'. If you are using mac, and you are not the administrator on your computer, type su (Whatever the name of the admin. user is)
For example, su adminUsername
Then type
pip install base65536

Error installing Pillow (Django)

I'm having trouble getting Pillow to install.
Here's the full traceback:
Collecting Pillow
Using cached Pillow-4.0.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting olefile (from Pillow)
Using cached olefile-0.44.zip
Installing collected packages: olefile, Pillow
Running setup.py install for olefile ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/bt/_3d4816x12d95tzvcp_0302w0000gn/T/pip-build-UyBMYN/olefile/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/bt/_3d4816x12d95tzvcp_0302w0000gn/T/pip-QHsEXV-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib
copying OleFileIO_PL.py -> build/lib
creating build/lib/olefile
copying olefile/__init__.py -> build/lib/olefile
copying olefile/olefile.py -> build/lib/olefile
copying olefile/README.rst -> build/lib/olefile
copying olefile/README.html -> build/lib/olefile
copying olefile/LICENSE.txt -> build/lib/olefile
copying olefile/CONTRIBUTORS.txt -> build/lib/olefile
running install_lib
creating /Library/Python/2.7/site-packages/olefile
error: could not create '/Library/Python/2.7/site-packages/olefile': Permission denied
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/bt/_3d4816x12d95tzvcp_0302w0000gn/T/pip-build-UyBMYN/olefile/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/bt/_3d4816x12d95tzvcp_0302w0000gn/T/pip-QHsEXV-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/bt/_3d4816x12d95tzvcp_0302w0000gn/T/pip-build-UyBMYN/olefile/
The error seems to be 'Permission denied' when attempting to create the folder; though I cannot understand why...
My machine is running Mac OSX, and I'm using Terminal to run the commands for this Django project.
Because the normal user doesn't have permission to install packages globally. Either run with sudo, or - much better - use a virtualenv and install your packages in there.
There're several questions regarding this problem, I'd suggest to take a look at these:
Using virtualenv https://stackoverflow.com/a/19472082/394647
Using $HOMEhttps://stackoverflow.com/a/7143496/394647
I prefer the second one but it also depends on your project/app structure

Categories