Problem description:
In VS Code, run the command pip install bpy (as indicated in https://pypi.org/project/bpy/) and get the following error message:
PS C:\Users\(...)\Local\Programs\Python\Python38> pip install bpy
Collecting bpy
Using cached bpy-0.0.0a0.tar.gz (19 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\(...)\local\programs\python\python38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\(...)\\Local\\Temp\\pip-install-xln6pb4c\\bpy\\setup.py'"'"'; __file__='"'"'C:\\Users\\(...)\\Local\\Temp\\pip-install-xln6pb4c\\bpy\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\(...)\Local\Temp\pip-pip-egg-info-0pdk7e9q'
cwd: C:\Users\(...)\Local\Temp\pip-install-xln6pb4c\bpy\
Complete output (16 lines):
Traceback (most recent call last):
File "c:\users\(...)\local\programs\python\python38\lib\tokenize.py", line 342, in find_cookie
codec = lookup(encoding)
LookupError: unknown encoding: future_fstrings
During handling of the above exception, another exception occurred:
File "<string>", line 1, in <module>
File "c:\users\(...)\local\programs\python\python38\lib\tokenize.py", line 394, in open
encoding, lines = detect_encoding(buffer.readline)
File "c:\users\(...)\local\programs\python\python38\lib\tokenize.py", line 381, in detect_encoding
encoding = find_cookie(second)
File "c:\users\(...)\local\programs\python\python38\lib\tokenize.py", line 350, in find_cookie
raise SyntaxError(msg)
SyntaxError: unknown encoding for 'C:\\Users\\(...)\\Local\\Temp\\pip-install-xln6pb4c\\bpy\\setup.py': future_fstrings
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. code here
------- What I tried (without success): -------
Installed wheels (pip install wheel), then downloaded the package from pypi.org to manually install:
pip install 'C:\Users(...)\Downloads\bpy-2.82.1.tar.gz'
got the same error.
------- Conclusion: -------
Cannot use bpy outside of Blender. I found some workarounds (which I have yet to try) on another post on Blender Stack Exchange
Thanks Anand and phd for the very useful links!
From what I understand it is actually possible to run bpy outside blender and information that claims otherwise was written for older versions. I have to admit though that I am still in progress of installing bpy which is not an easy task and I cannot verify this, yet.
In your case, a pip module is missing. You can install it with pip install future_fstrings. Have a look at https://pypi.org/project/bpy/ for more guidelines.
EDIT: I was able to install bpy under Windows and Linux. It throws some errors on Linux but works fine under Windows. And absolutely works standalone!
I used a lot of trial and error and found out that using a Python version of 3.7.6 and pip version of 20.2.4, I was able to install bpy version - 2.82.1 by pip install bpy. I am using Windows 10 and Anaconda prompt.
I guess you can't install bpy because you're installing bpy by python 3.8 version.
You have do downgrade your python version to 3.7
Check out https://pypi.org/project/bpy/
then you can see bpy module requires version of Python >=3.7, <3.8
TL:DR- install from prebuilt wheel, not from standard pip install bpy && bpy_post_install
Errors installing on macos:
I have been trying to install it for the last 8 hours or so.
My installation steps thus far:
I built the blender app from source, following instructions on blender.org
According to the bpy github repo- bpy depends upon bpy-build (though it's not in the prerequisites).
The bpy-build github repo doesn't have great installation instructions, and the setup.py script specifically declares the OS as windows. So, I basically just skipped this- a possible cause of the install failures.
In two different attempts, I used both pyenv and virtualenv, to create a python 3.7 dev environment. Both resulted in a hanging install for pip install bpy during the running of setup.py. The actual error from the pip install is:
Collecting bpy
Using cached https://files.pythonhosted.org/packages/4b/ed/ba6092b691acc5b157891421d9fde4a9dd5dcc8a8b93a4e8119fec261391/bpy-2.82.1.tar.gz
Installing collected packages: bpy
Running setup.py install for bpy ... error
ERROR: Command errored out with exit status 1:
command: /<path-to-venv>/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4n/wsjhxhbn0pb11r7cyqcvtxcc0000gn/T/pip-install-m6rixhki/bpy/setup.py'"'"'; __file__='"'"'/private/var/folders/4n/wsjhxhbn0pb11r7cyqcvtxcc0000gn/T/pip-install-m6rixhki/bpy/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/4n/wsjhxhbn0pb11r7cyqcvtxcc0000gn/T/pip-record-ti3q9j4a/install-record.txt --single-version-externally-managed --compile --install-headers /<path-to-venv>/venv/include/site/python3.7/bpy
cwd: /private/var/folders/4n/wsjhxhbn0pb11r7cyqcvtxcc0000gn/T/pip-install-m6rixhki/bpy/
Complete output (58 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.7
creating build/lib.macosx-10.9-x86_64-3.7/blenderpy
copying blenderpy/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/blenderpy
copying blenderpy/pre_uninstall.py -> build/lib.macosx-10.9-x86_64-3.7/blenderpy
copying blenderpy/post_install.py -> build/lib.macosx-10.9-x86_64-3.7/blenderpy
running build_ext
Preparing the build environment
Searching for compatible Blender online (this will take a while)
Found compatible Blender version 2.82
Cloning Blender source from git (this will take a while)
Cloning precompiled libs from svn (this will take a while)
cmake -DWITH_PYTHON_INSTALL=OFF -DWITH_PYTHON_MODULE=ON -DWITH_OPENMP=OFF -DWITH_AUDASPACE=OFF -S/private/var/folders/4n/wsjhxhbn0pb11r7cyqcvtxcc0000gn/T/pip-install-m6rixhki/bpy/build/temp.macosx-10.9-x86_64-3.7/blender -B/private/var/folders/4n/wsjhxhbn0pb11r7cyqcvtxcc0000gn/T/pip-install-m6rixhki/bpy/build/temp.macosx-10.9-x86_64-3.7/build
-- The C compiler identification is AppleClang 12.0.5.12050022
-- The CXX compiler identification is AppleClang 12.0.5.12050022
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detected OS X 11.3 and Xcode 12. at /Applications/Xcode.app
-- OSX_SYSROOT_PREFIX: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
-- Setting deployment target to 10.11, lower versions are not supported
CMake Warning at CMakeLists.txt:580 (message):
WITH_OPENAL requires WITH_AUDASPACE which is disabled
CMake Warning at CMakeLists.txt:584 (message):
WITH_JACK requires WITH_AUDASPACE which is disabled
-- WITH_DRACO requires WITH_PYTHON_INSTALL to be ON, disabling WITH_DRACO for now
-- Performing Test SUPPORT_SSE_BUILD
-- Performing Test SUPPORT_SSE_BUILD - Success
-- SSE Support: detected.
-- Performing Test SUPPORT_SSE2_BUILD
-- Performing Test SUPPORT_SSE2_BUILD - Success
-- SSE2 Support: detected.
-- Found Git: /usr/bin/git (found version "2.30.1 (Apple Git-130)")
CMake Error at build_files/cmake/platform/platform_apple.cmake:38 (message):
Mac OSX requires pre-compiled libs at:
'/private/var/folders/4n/wsjhxhbn0pb11r7cyqcvtxcc0000gn/T/pip-install-m6rixhki/bpy/build/temp.macosx-10.9-x86_64-3.7/blender/../lib/darwin'
Call Stack (most recent call first):
CMakeLists.txt:808 (include)
-- Configuring incomplete, errors occurred!
See also "/private/var/folders/4n/wsjhxhbn0pb11r7cyqcvtxcc0000gn/T/pip-install-m6rixhki/bpy/build/temp.macosx-10.9-x86_64-3.7/build/CMakeFiles/CMakeOutput.log".
See also "/private/var/folders/4n/wsjhxhbn0pb11r7cyqcvtxcc0000gn/T/pip-install-m6rixhki/bpy/build/temp.macosx-10.9-x86_64-3.7/build/CMakeFiles/CMakeError.log".
error: command 'cmake' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /<path to venv>/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4n/wsjhxhbn0pb11r7cyqcvtxcc0000gn/T/pip-install-m6rixhki/bpy/setup.py'"'"'; __file__='"'"'/private/var/folders/4n/wsjhxhbn0pb11r7cyqcvtxcc0000gn/T/pip-install-m6rixhki/bpy/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/4n/wsjhxhbn0pb11r7cyqcvtxcc0000gn/T/pip-record-ti3q9j4a/install-record.txt --single-version-externally-managed --compile --install-headers /<path to venv>/venv/include/site/python3.7/bpy Check the logs for full command output.
**** The breakthrough ****
While writing this, I noticed the option in the bpy github page to install via pre-build wheel rather than the usual pip install bpy && bpy_post_install. You have to go to some 'sketchy' sites to download the file, but after I downloaded it and installed it that way I was able to run blender scripts outside of the blender app!!
Unfortunately the ‘bpy’ module cannot be used outside of Blender.
More details are here: https://creativepolygon.com/development/starting-with-bpy-blender-python-part-1-installation
Related
I am on Ubuntu 20.04LTS, and I try to install pygame (for python) for a school project. But when I try this:
sudo pip3 install pygame
I received an error:
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-szdn6q_u/pygame/setup.py'"'"'; __file__='"'"'/tmp/pip-install-szdn6q_u/pygame/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-3fqnujta
cwd: /tmp/pip-install-szdn6q_u/pygame/
Complete output (18 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using UNIX configuration...
Hunting dependencies...
SDL : found 1.2.15
FONT : not found
IMAGE : not found
MIXER : not found
PNG : found
JPEG : found
SCRAP : found
PORTMIDI: not found
PORTTIME: not found
FREETYPE: found 23.1.17
Missing dependencies
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Can you help me, please?
Try installing it with
sudo apt install python3-pygame
instead. The error you are getting is because you are missing the Pygame dependencies, which apt should install for you.
As a general rule, it’s a good idea to install Python packages through the package manager, and use pip only if they’re unavailable there.
Try install like this:
python3 -m pip install pygame==1.9.5rc2
I was having same problem and it worked very well.
Installing numba and llvmlite Python on Windows 10 failure
I have tried to install Python numba on Windows 10 using
pip install numba
with partial success, but a failure installing llvmlite
Requirement already satisfied: numpy>=1.15 in c:\users\paul\appdata\local\programs\python\python39\lib\site-packages (from numba) (1.19.2+mkl)
Requirement already satisfied: setuptools in c:\users\paul\appdata\local\programs\python\python39\lib\site-packages (from numba) (49.2.1)
Building wheels for collected packages: numba, llvmlite
Building wheel for numba (setup.py) ... done
Created wheel for numba: filename=numba-0.51.2-cp39-cp39-win_amd64.whl size=2173229 sha256=249a12f2e1436ac244e2730f6e7ddb5bd53413460dcbdc4ed4e6aeebbf16d6ce
Stored in directory: c:\users\paul\appdata\local\pip\cache\wheels\0a\51\41\9f5a61bcd9d25271d7021e05cbabcd574fb3d534d07654b780
Building wheel for llvmlite (setup.py) ... error
ERROR: Command errored out with exit status 1:
CMake Error at CMakeLists.txt:9 (find_package):
Could not find a package configuration file provided by "LLVM" with any of
the following names:
LLVMConfig.cmake
llvm-config.cmake
Add the installation prefix of "LLVM" to CMAKE_PREFIX_PATH or set
"LLVM_DIR" to a directory containing one of the above files. If "LLVM"
provides a separate development package or SDK, be sure it has been installed.
-- Configuring incomplete, errors occurred!
Doesn't know where LLVM is installed?
So I used Windows Environment editor to add LLVM_DIR with value C:\Program Files\mingw-w64\winlibs-x86_64-posix-seh-gcc-9.3.0-llvm-10.0.0-mingw-w64-7.0.0-r4\mingw64\lib\cmake\llvm
in the hope that it will use one of the four Clang versions that I have installed at C:\LLVM\clang-1100, C:\LLVM\clang-1000 ...
latest binary is C:\LLVM\clang-1100\LLVM\bin
I also have VS 1017 and 1019 installed, and all compilers are working OK from other IDEs and builds.
and downloaded the most recent wheel
llvmlite-0.34.0-cp39-cp39-win_amd64.whl
and added LLVM_DIR to system PATH
C:\Program Files\mingw-w64\winlibs-x86_64-posix-seh-gcc-9.3.0-llvm-10.0.0-mingw-w64-7.0.0-r4\mingw64\lib\cmake\llvm
This allows it to more nearly work, but fails using MSVC
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(399,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build\ZERO_CHECK.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(399,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build\llvmlite.vcxproj]
LINK : fatal error LNK1181: cannot open input file 'D:\winlibs64_stage\custombuilt\lib\libffi.dll.a' [C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build\llvmlite.vcxproj]
Trying generator 'Visual Studio 15 2017 Win64'
Traceback (most recent call last):
File "C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build.py", line 191, in <module>
main()
File "C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build.py", line 179, in main
main_win32()
File "C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build.py", line 94, in main_win32
subprocess.check_call(['cmake', '--build', build_dir, '--config', config])
File "c:\users\paul\appdata\local\programs\python\python39\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', 'C:\\Users\\Paul\\AppData\\Local\\Temp\\pip-install-xvvf77_z\\llvmlite\\ffi\\build', '--config', 'Release']' returned non-zero exit status 1.
error: command 'c:\\users\\paul\\appdata\\local\\programs\\python\\python39\\python.exe' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\paul\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Paul\\AppData\\Local\\Temp\\pip-install-xvvf77_z\\llvmlite\\setup.py'"'"'; __file__='"'"'C:\\Users\\Paul\\AppData\\Local\\Temp\\pip-install-xvvf77_z\\llvmlite\\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\Paul\AppData\Local\Temp\pip-record-l4absc_g\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\paul\appdata\local\programs\python\python39\Include\llvmlite' Check the logs for full command output.
This suggests that the output folder location is not specified, or that VS incremental build option is not set to 'not used'.
Or that I should use an LLVM version, but I don't know how to specify which one, and not use VS2017.
Suggestions how to get out of this rabbit hole most welcome ;-)
Thanks
Paul
I wanted to install librosa but I get stack with this error, but I managed to solve it with this:
first I download the last version of llvmlite Here
than I run the following command:
pip install llvmlite-0.35.0-cp39-cp39-win_amd64.whl
next for all packages need by librosa I install them as follow:
pip install --no-deps packageName
or just for more sample do as follow :
pip install librosa --ignore-installed llvmlite
I installed pcketsphinx on Anaconda using conda-forge in this way.
conda install -c conda-forge pocketsphinx
And then I got the following message
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- pocketsphinx
Current channels:
- https://conda.anaconda.org/conda-forge/win-64
- https://conda.anaconda.org/conda-forge/noarch
- https://repo.anaconda.com/pkgs/main/win-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/win-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://repo.anaconda.com/pkgs/msys2/win-64
- https://repo.anaconda.com/pkgs/msys2/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
Why does it say "The following packages are not available from current channels:"?
How do I make pocketsphinx available to me?
I also tried pip install, but got an error.
pip install pocketsphinx
ERROR: Command errored out with exit status 1:
command: 'C:\Users\taichi\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\setup.py'"'"'; __file__='"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\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\taichi\AppData\Local\Temp\pip-wheel-2isplwue' --python-tag cp37
cwd: C:\Users\taichi\AppData\Local\Temp\pip-install-ha8v9dja\pocketsphinx\
Complete output (6 lines):
running bdist_wheel
running build_ext
building 'sphinxbase._sphinxbase' extension
swigging deps/sphinxbase/swig/sphinxbase.i to deps/sphinxbase/swig/sphinxbase_wrap.c
swig.exe -python -modern -threads -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/win32 -Ideps/sphinxbase/swig -outdir sphinxbase -o deps/sphinxbase/swig/sphinxbase_wrap.c deps/sphinxbase/swig/sphinxbase.i
error: command 'swig.exe' failed: No such file or directory
----------------------------------------
ERROR: Failed building wheel for pocketsphinx
Running setup.py clean for pocketsphinx
Failed to build pocketsphinx
Installing collected packages: pocketsphinx
Running setup.py install for pocketsphinx ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\taichi\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\setup.py'"'"'; __file__='"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\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\taichi\AppData\Local\Temp\pip-record-8osso05j\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\taichi\AppData\Local\Temp\pip-install-ha8v9dja\pocketsphinx\
Complete output (6 lines):
running install
running build_ext
building 'sphinxbase._sphinxbase' extension
swigging deps/sphinxbase/swig/sphinxbase.i to deps/sphinxbase/swig/sphinxbase_wrap.c
swig.exe -python -modern -threads -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/win32 -Ideps/sphinxbase/swig -outdir sphinxbase -o deps/sphinxbase/swig/sphinxbase_wrap.c deps/sphinxbase/swig/sphinxbase.i
error: command 'swig.exe' failed: No such file or directory
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\taichi\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\setup.py'"'"'; __file__='"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\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\taichi\AppData\Local\Temp\pip-record-8osso05j\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
I'm using Anaconda3 and Python 3.7.4 and Windows 10 64bit.
I came across what looks like the same problem and was able to solve it with the following steps. Hopefully this will help you and others, at least to get started. Consider the following general points:
Anaconda/Miniconda had a version of gcc that was picked up as the default compiler and, it seems, was interfering. Make sure gcc is picking up the desired compiler. To see what compilers you have, start up a terminal window, type gcc+TAB (gcc followed by a tab). This should show all the versions you have on your system. Type gcc --version to see which version is the default. And which gcc to find out where it is located, e.g. /Users/PatrickT/miniconda/bin/gcc
You want to ensure that your system's PATH can find your compiler. This may be done by adding an export command to your bash profile. On Catalina, apparently, the bash profile information would be placed in .zshrc. To find this file, type COMMAND+SHIFT+E to make invisible files visible and look in your home directory (/Users/PatrickT in my case). For instance, add a line like export PATH="/usr/local/gcc-10/bin:$PATH". The path is of course dependent on your system.
To make sure miniconda was not interfering, I took it off the PATH altogether. I also installed the latest version of xcode from the apple binaries. Once I had an updated version of the gcc compiler found by my system, I was able to install pocketsphinx as well as other programs that I was having problems with, like kaldi or zlib.
Getting miniconda to work again without interfering with gcc is a problem I haven't solved. As soon as I put miniconda back on the PATH, the default gcc reverted to the miniconda version. To be continued...
You can:
pip install pipwin
and
pipwin install pocketsphinx
I was having the same issue and got into this site:
https://cppsecrets.com/users/11429798104105115104101107117115104119971049754494864103109971051084699111109/python-pocketsphinx-installation-on-windows.php
I am using python3.7.2 and pip 19.2.2 for a python application. The problem is that I can't install the dependency psycopg2 2.8.3 on MacOS.
Below is the error I got on running pip install psycopg2:
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for psycopg2
It seems that ssl is not installed so I tried to install pip install sssl but got this error:
ERROR: Command errored out with exit status 1:
command: /Users/joey/.pyenv/versions/3.7.2/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/9c/fcm6pxnj39b1t777zpcfpbdh0000gn/T/pip-install-2ldzdiz0/ssl/setup.py'"'"'; __file__='"'"'/private/var/folders/9c/fcm6pxnj39b1t777zpcfpbdh0000gn/T/pip-install-2ldzdiz0/ssl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /private/var/folders/9c/fcm6pxnj39b1t777zpcfpbdh0000gn/T/pip-install-2ldzdiz0/ssl/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/9c/fcm6pxnj39b1t777zpcfpbdh0000gn/T/pip-install-2ldzdiz0/ssl/setup.py", line 33
print 'looking for', f
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('looking for', f)?
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I don't understand why it failed. Is this because of a wrong version or relates to MacOS?
I have tried the method mentioned in this post: How to install psycopg2 with "pip" on Python?. I installed postgressql on the Mac and added /usr/local/Cellar/postgresql/11.5/bin/ on PATH env. But it doesn't help.
I think this thread may be of help error installing psycopg2, library not found for -lssl
clang is the default c compiler on osx, and is required for some python libraries to be built correctly. The ssl error is actually the clang linker complaining that there is no ssl library available to be used. The above thread should resolve your issue.
I had the same issue, and looked at the thread posted by Nate, but found my solution here: How to update Xcode from command line, posted by Roy Huang, who referenced https://forums.developer.apple.com/thread/104296
It turns out Mojave and/or Xcode 10 does not create a /usr/include directory, which psycopg2 needs to be able to install.
In trying to install a python package via pip I get the error:
Failed building wheel for atari-py
Running setup.py clean for atari-py
Failed to build atari-py
Installing collected packages: atari-py, PyOpenGL
Running setup.py install for atari-py ... error
Complete output from command C:\Users\xxxxxx\AppData\Local\Continuum\Anaconda2\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\xxxxxx\\appdata\\local\\temp\\pip-build-qhuh1q\\atari-py\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\xxxxxx\appdata\local\temp\pip-z8wnzs-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
Unable to execute 'make build -C atari_py/ale_interface -j 3'. HINT: are you sure `make` is installed?
error: [Error 2] The system cannot find the file specified
In my system when I type make:
C:\Users\xxxxxx>make
'make' is not recognized as an internal or external command,
operable program or batch file.
So, clearly make is missing. But I installed make using conda:
C:\Users\xxxxxx>conda install mingw
Fetching package metadata .........
Solving package specifications: ..........
# All requested packages already installed.
# packages in environment at C:\Users\xxxxxx\AppData\Local\Continuum\Anaconda2:
#
mingw 4.7
So I have mingw 4.7 already installed.
How could I remove the error and get the package?
Many thanks for the help.
make is not in your PATH.
Do echo %PATH% and check if the path to your msys utilities is in there. Otherwise you can edit this variable by following the instructions here: Adding directory to PATH Environment Variable in Windows