Unable to run pytest, no module named readline - python-3.x

sh-4.2# python --version
Python 3.5.2
sh-4.2# pip --version
pip 9.0.1 from /usr/local/lib/python3.5/site-packages (python 3.5)
sh-4.2# pytest --version
pytest 6.1.0
sh-4.2# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
When launching pytest on my project, I have the following stacktrace:
sh-4.2# pytest
/usr/local/lib/python3.5/site-packages/addok/config/__init__.py:2: PendingDeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/usr/local/lib/python3.5/site-packages/addok/shell.py", line 23, in <module>
INTERNALERROR> import gnureadline as readline # For OSX.
INTERNALERROR> ImportError: No module named 'gnureadline'
INTERNALERROR>
INTERNALERROR> During handling of the above exception, another exception occurred:
INTERNALERROR>
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/usr/local/lib/python3.5/site-packages/_pytest/main.py", line 253, in wrap_session
INTERNALERROR> config._do_configure()
INTERNALERROR> File "/usr/local/lib/python3.5/site-packages/_pytest/config/__init__.py", line 982, in _do_configure
INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR> File "/usr/local/lib/python3.5/site-packages/pluggy/hooks.py", line 308, in call_historic
INTERNALERROR> res = self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/usr/local/lib/python3.5/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/usr/local/lib/python3.5/site-packages/pluggy/manager.py", line 87, in <lambda>
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/usr/local/lib/python3.5/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/usr/local/lib/python3.5/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/usr/local/lib/python3.5/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/usr/local/lib/python3.5/site-packages/addok/pytest.py", line 27, in pytest_configure
INTERNALERROR> addok_config.load()
INTERNALERROR> File "/usr/local/lib/python3.5/site-packages/addok/config/__init__.py", line 36, in load
INTERNALERROR> self.load_core_plugins()
INTERNALERROR> File "/usr/local/lib/python3.5/site-packages/addok/config/__init__.py", line 68, in load_core_plugins
INTERNALERROR> plugin = importlib.import_module(path)
INTERNALERROR> File "/usr/local/lib/python3.5/importlib/__init__.py", line 126, in import_module
INTERNALERROR> return _bootstrap._gcd_import(name[level:], package, level)
INTERNALERROR> File "<frozen importlib._bootstrap>", line 986, in _gcd_import
INTERNALERROR> File "<frozen importlib._bootstrap>", line 969, in _find_and_load
INTERNALERROR> File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
INTERNALERROR> File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
INTERNALERROR> File "/usr/local/lib/python3.5/site-packages/_pytest/assertion/rewrite.py", line 171, in exec_module
INTERNALERROR> exec(co, module.__dict__)
INTERNALERROR> File "/usr/local/lib/python3.5/site-packages/addok/shell.py", line 25, in <module>
INTERNALERROR> import readline # Normal way.
INTERNALERROR> ImportError: No module named 'readline'
As a consequence, I install readline:
sh-4.2# pip install readline
Which gives the following error:
============ Building the readline extension module ============
running bdist_wheel
running build
running build_ext
building 'readline' extension
creating build
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/Modules
creating build/temp.linux-x86_64-3.5/Modules/3.x
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_RL_CALLBACK -DHAVE_RL_CATCH_SIGNAL -DHAVE_RL_COMPLETION_APPEND_CHARACTER -DHAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK -DHAVE_RL_COMPLETION_MATCHES -DHAVE_RL_COMPLETION_SUPPRESS_APPEND -DHAVE_RL_PRE_INPUT_HOOK -I. -I/usr/local/include/python3.5m -c Modules/3.x/readline.c -o build/temp.linux-x86_64-3.5/Modules/3.x/readline.o -Wno-strict-prototypes
Modules/3.x/readline.c: In function ‘PyInit_readline’:
Modules/3.x/readline.c:1179:34: warning: assignment from incompatible pointer type [enabled by default]
PyOS_ReadlineFunctionPointer = call_readline;
^
creating build/lib.linux-x86_64-3.5
gcc -pthread -shared build/temp.linux-x86_64-3.5/Modules/3.x/readline.o readline/libreadline.a readline/libhistory.a -L/usr/local/lib -lncurses -lpython3.5m -o build/lib.linux-x86_64-3.5/readline.cpython-35m-x86_64-linux-gnu.so
/usr/bin/ld: cannot find -lncurses
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for readline
Running setup.py clean for readline
Failed to build readline
Installing collected packages: readline
Running setup.py install for readline ... error
Complete output from command /usr/local/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-d484khsy/readline/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-0sdba9rg-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'readline' extension
creating build
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/Modules
creating build/temp.linux-x86_64-3.5/Modules/3.x
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_RL_CALLBACK -DHAVE_RL_CATCH_SIGNAL -DHAVE_RL_COMPLETION_APPEND_CHARACTER -DHAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK -DHAVE_RL_COMPLETION_MATCHES -DHAVE_RL_COMPLETION_SUPPRESS_APPEND -DHAVE_RL_PRE_INPUT_HOOK -I. -I/usr/local/include/python3.5m -c Modules/3.x/readline.c -o build/temp.linux-x86_64-3.5/Modules/3.x/readline.o -Wno-strict-prototypes
Modules/3.x/readline.c: In function ‘PyInit_readline’:
Modules/3.x/readline.c:1179:34: warning: assignment from incompatible pointer type [enabled by default]
PyOS_ReadlineFunctionPointer = call_readline;
^
creating build/lib.linux-x86_64-3.5
gcc -pthread -shared build/temp.linux-x86_64-3.5/Modules/3.x/readline.o readline/libreadline.a readline/libhistory.a -L/usr/local/lib -lncurses -lpython3.5m -o build/lib.linux-x86_64-3.5/readline.cpython-35m-x86_64-linux-gnu.so
/usr/bin/ld: cannot find -lncurses
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/local/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-d484khsy/readline/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-0sdba9rg-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-d484khsy/readline/
Which I do not know how to fix.
How can I fix the above error in order to run pytest ? Is it at least the correct direction in order to by able to run pytest ?
Moreover, this takes place in a docker container which image is https://hub.docker.com/layers/saagie/python/3.5.2-1.3.1-centos/images/sha256-6dc9637c93ae1ba0f5553707da1e97fe7c81c883b501e6717624f6e65f9d0f22?context=explore

To be able to get the readline module and compile it, the compiler needs ncurses library.
This library can be downloaded via:
yum update
yum install ncurses-devel
Then:
pip install readline
Source:
https://www.osetc.com/en/how-to-install-ncurse-library-in-ubuntu-debian-centos-fedora-linux.html

Related

Encountered a problem while installing [ FastText ] library on MacOS

I have been trying to install the "FastText" library on macOS but I keep encountering a Runtime error.
System - MacOS: 13.0.1 (22A400)
Python Version: 3.10
IDE: Pycharm
I tried installing it from Pycharm but it did not work, then i tried using the Terminal and this is what i got.
pip3 install fasttext and sudo pip3 install fasttext
all resulted with the same error below:
Using cached fasttext-0.9.2.tar.gz (68 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: pybind11>=2.2 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from fasttext) (2.10.2)
Requirement already satisfied: setuptools>=0.7.0 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from fasttext) (65.5.0)
Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from fasttext) (1.21.4)
Building wheels for collected packages: fasttext
Building wheel for fasttext (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [67 lines of output]
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/dist.py:771: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
warnings.warn(
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-universal2-cpython-310
creating build/lib.macosx-10.9-universal2-cpython-310/fasttext
copying python/fasttext_module/fasttext/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/fasttext
copying python/fasttext_module/fasttext/FastText.py -> build/lib.macosx-10.9-universal2-cpython-310/fasttext
creating build/lib.macosx-10.9-universal2-cpython-310/fasttext/util
copying python/fasttext_module/fasttext/util/util.py -> build/lib.macosx-10.9-universal2-cpython-310/fasttext/util
copying python/fasttext_module/fasttext/util/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/fasttext/util
creating build/lib.macosx-10.9-universal2-cpython-310/fasttext/tests
copying python/fasttext_module/fasttext/tests/test_script.py -> build/lib.macosx-10.9-universal2-cpython-310/fasttext/tests
copying python/fasttext_module/fasttext/tests/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/fasttext/tests
copying python/fasttext_module/fasttext/tests/test_configurations.py -> build/lib.macosx-10.9-universal2-cpython-310/fasttext/tests
running build_ext
creating var
creating var/folders
creating var/folders/xg
creating var/folders/xg/jxm9dqwn5k3f4m0ns9rwyldw0000gn
creating var/folders/xg/jxm9dqwn5k3f4m0ns9rwyldw0000gn/T
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c /var/folders/xg/jxm9dqwn5k3f4m0ns9rwyldw0000gn/T/tmpejxme0zs.cpp -o var/folders/xg/jxm9dqwn5k3f4m0ns9rwyldw0000gn/T/tmpejxme0zs.o -stdlib=libc++
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c /var/folders/xg/jxm9dqwn5k3f4m0ns9rwyldw0000gn/T/tmpyu7_bprq.cpp -o var/folders/xg/jxm9dqwn5k3f4m0ns9rwyldw0000gn/T/tmpyu7_bprq.o -stdlib=libc++ -mmacosx-version-min=10.7
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/private/var/folders/xg/jxm9dqwn5k3f4m0ns9rwyldw0000gn/T/pip-install-mv_4oqbh/fasttext_1af9a5c892f74b668dc43e515183597f/setup.py", line 168, in <module>
setup(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command
super().run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in run
self.run_command('build')
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command
super().run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/command/build.py", line 132, in run
self.run_command(cmd_name)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command
super().run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 84, in run
_build_ext.run(self)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
self.build_extensions()
File "/private/var/folders/xg/jxm9dqwn5k3f4m0ns9rwyldw0000gn/T/pip-install-mv_4oqbh/fasttext_1af9a5c892f74b668dc43e515183597f/setup.py", line 131, in build_extensions
raise RuntimeError(
RuntimeError: libc++ is needed! Failed to compile with -stdlib=libc++ -mmacosx-version-min=10.7 and -stdlib=libc++.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for fasttext
Running setup.py clean for fasttext
Failed to build fasttext
Installing collected packages: fasttext
Running setup.py install for fasttext ... error
error: subprocess-exited-with-error
× Running setup.py install for fasttext did not run successfully.
│ exit code: 1
╰─> [66 lines of output]
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/dist.py:771: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
warnings.warn(
running install
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build/lib.macosx-10.9-universal2-cpython-310
creating build/lib.macosx-10.9-universal2-cpython-310/fasttext
copying python/fasttext_module/fasttext/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/fasttext
copying python/fasttext_module/fasttext/FastText.py -> build/lib.macosx-10.9-universal2-cpython-310/fasttext
creating build/lib.macosx-10.9-universal2-cpython-310/fasttext/util
copying python/fasttext_module/fasttext/util/util.py -> build/lib.macosx-10.9-universal2-cpython-310/fasttext/util
copying python/fasttext_module/fasttext/util/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/fasttext/util
creating build/lib.macosx-10.9-universal2-cpython-310/fasttext/tests
copying python/fasttext_module/fasttext/tests/test_script.py -> build/lib.macosx-10.9-universal2-cpython-310/fasttext/tests
copying python/fasttext_module/fasttext/tests/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/fasttext/tests
copying python/fasttext_module/fasttext/tests/test_configurations.py -> build/lib.macosx-10.9-universal2-cpython-310/fasttext/tests
running build_ext
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c /var/folders/xg/jxm9dqwn5k3f4m0ns9rwyldw0000gn/T/tmp7pgbysh_.cpp -o var/folders/xg/jxm9dqwn5k3f4m0ns9rwyldw0000gn/T/tmp7pgbysh_.o -stdlib=libc++
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c /var/folders/xg/jxm9dqwn5k3f4m0ns9rwyldw0000gn/T/tmp7hnnqnja.cpp -o var/folders/xg/jxm9dqwn5k3f4m0ns9rwyldw0000gn/T/tmp7hnnqnja.o -stdlib=libc++ -mmacosx-version-min=10.7
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/private/var/folders/xg/jxm9dqwn5k3f4m0ns9rwyldw0000gn/T/pip-install-mv_4oqbh/fasttext_1af9a5c892f74b668dc43e515183597f/setup.py", line 168, in <module>
setup(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command
super().run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/command/install.py", line 68, in run
return orig.install.run(self)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/command/install.py", line 698, in run
self.run_command('build')
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command
super().run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/command/build.py", line 132, in run
self.run_command(cmd_name)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command
super().run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 84, in run
_build_ext.run(self)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
self.build_extensions()
File "/private/var/folders/xg/jxm9dqwn5k3f4m0ns9rwyldw0000gn/T/pip-install-mv_4oqbh/fasttext_1af9a5c892f74b668dc43e515183597f/setup.py", line 131, in build_extensions
raise RuntimeError(
RuntimeError: libc++ is needed! Failed to compile with -stdlib=libc++ -mmacosx-version-min=10.7 and -stdlib=libc++.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> fasttext
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure. ```
As an initial observation: it's often a good practice to install the Python libraries you need for a particular development project into a project-specific virtual environment.
That is, you set up a separate and specific Python interpreter, of a version you consciously choose, with its own set of installed libraries, which does not then affect the system's default Python installation in any way. It then becomes easier to choose whatever libraries/versions you need for that project, without any risk of confusing things for other programs on the same system. It also helps enforce a clear declaration of your project's actual prerequisites, so that you can re-create an adequante virtual-environment later when needed in new places – rather than leaving that to the chance/history of what's been globally installed on the devlopment machine.
Either the conda tool or the venv functionality of Python 3 can be used to set up such an environment, and after creation, each time you want to use that specific Python installation, you must activate it – so that in a particular shell, it becomes the active Python.
All that said, the error you're having relates to the lack of needed c++ development tools, which your installation-method seems to require to compile to those non-Python parts of Facebook's FastText library.
A bunch of options you could consider to get around this:
installing Apple's full XCode, including C++ & a bunch of other compilation/build tools, might resolve or change your error. There's more discussion from people who've hit a similar error, and eventually gotten around it using XCode-related configuration, at an issue in the Fasttext project: https://github.com/facebookresearch/fastText/issues/753
if using conda – I usually start with miniconda per the minimal instructions at https://docs.conda.io/en/latest/miniconda.html – it might be smart enough to choose a package already precompiled properly for your setup, even if you don't have C++ build tools locally. That is, after setting up your desired environment, then activating it, doing a conda install fasttext inside that environment might just work for you, skipping the local compilation error.
depending on your fasttext needs, you might also consider using some other Python library with FastText support, like Gensim. It doesn't support -supervised mode, but does support the core word-vectors (and synthesis of out-of-vocabulary word-vectors via character n-grams) capabilities of FastText, with some extra flexibility & related utility functions.

Errors when installing onnx with pip in Ubuntu 20.04

I'm trying to install onnx in a fresh Ubuntu 20.04 install, but I'm running into the error bellow. It seems that I need the protobuf compiler, although I haven't found any documentation that says that I need that package installed.
$ sudo python3 -m pip install 'onnx>=1.1.2'
Collecting onnx>=1.1.2
Using cached onnx-1.6.0.tar.gz (3.1 MB)
Requirement already satisfied: numpy in /usr/local/lib/python3.8/dist-packages (from onnx>=1.1.2) (1.18.3)
Requirement already satisfied: protobuf in /usr/lib/python3/dist-packages (from onnx>=1.1.2) (3.6.1)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from onnx>=1.1.2) (1.14.0)
Requirement already satisfied: typing-extensions>=3.6.2.1 in /usr/local/lib/python3.8/dist-packages (from onnx>=1.1.2) (3.7.4.2)
Building wheels for collected packages: onnx
Building wheel for onnx (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-akurq0e8/onnx/setup.py'"'"'; __file__='"'"'/tmp/pip-install-akurq0e8/onnx/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-zmzgb0kg
cwd: /tmp/pip-install-akurq0e8/onnx/
Complete output (64 lines):
fatal: not a git repository (or any of the parent directories): .git
running bdist_wheel
running build
running build_py
running create_version
running cmake_build
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Generated: /tmp/pip-install-akurq0e8/onnx/.setuptools-cmake-build/onnx/onnx-ml.proto
CMake Error at CMakeLists.txt:248 (message):
Protobuf compiler not found
Call Stack (most recent call first):
CMakeLists.txt:279 (relative_protobuf_generate_cpp)
-- Configuring incomplete, errors occurred!
See also "/tmp/pip-install-akurq0e8/onnx/.setuptools-cmake-build/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-akurq0e8/onnx/setup.py", line 315, in <module>
setuptools.setup(
File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.8/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 223, in run
self.run_command('build')
File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/lib/python3.8/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/tmp/pip-install-akurq0e8/onnx/setup.py", line 209, in run
self.run_command('cmake_build')
File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/tmp/pip-install-akurq0e8/onnx/setup.py", line 195, in run
subprocess.check_call(cmake_args)
File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/cmake', '-DPYTHON_INCLUDE_DIR=/usr/include/python3.8', '-DPYTHON_EXECUTABLE=/usr/bin/python3', '-DBUILD_ONNX_PYTHON=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=onnx', '-DPY_EXT_SUFFIX=.cpython-38-x86_64-linux-gnu.so', '-DCMAKE_BUILD_TYPE=Release', '-DONNX_ML=1', '/tmp/pip-install-akurq0e8/onnx']' returned non-zero exit status 1.
----------------------------------------
ERROR: Failed building wheel for onnx
Running setup.py clean for onnx
Failed to build onnx
Installing collected packages: onnx
Running setup.py install for onnx ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-akurq0e8/onnx/setup.py'"'"'; __file__='"'"'/tmp/pip-install-akurq0e8/onnx/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-txzgh5wg/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/onnx
cwd: /tmp/pip-install-akurq0e8/onnx/
Complete output (52 lines):
fatal: not a git repository (or any of the parent directories): .git
running install
running build
running build_py
running create_version
running cmake_build
Generated: /tmp/pip-install-akurq0e8/onnx/.setuptools-cmake-build/onnx/onnx-ml.proto
CMake Error at CMakeLists.txt:248 (message):
Protobuf compiler not found
Call Stack (most recent call first):
CMakeLists.txt:279 (relative_protobuf_generate_cpp)
-- Configuring incomplete, errors occurred!
See also "/tmp/pip-install-akurq0e8/onnx/.setuptools-cmake-build/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-akurq0e8/onnx/setup.py", line 315, in <module>
setuptools.setup(
File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.8/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/usr/lib/python3.8/distutils/command/install.py", line 589, in run
self.run_command('build')
File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/lib/python3.8/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/tmp/pip-install-akurq0e8/onnx/setup.py", line 209, in run
self.run_command('cmake_build')
File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/tmp/pip-install-akurq0e8/onnx/setup.py", line 195, in run
subprocess.check_call(cmake_args)
File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/cmake', '-DPYTHON_INCLUDE_DIR=/usr/include/python3.8', '-DPYTHON_EXECUTABLE=/usr/bin/python3', '-DBUILD_ONNX_PYTHON=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=onnx', '-DPY_EXT_SUFFIX=.cpython-38-x86_64-linux-gnu.so', '-DCMAKE_BUILD_TYPE=Release', '-DONNX_ML=1', '/tmp/pip-install-akurq0e8/onnx']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-akurq0e8/onnx/setup.py'"'"'; __file__='"'"'/tmp/pip-install-akurq0e8/onnx/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-txzgh5wg/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/onnx Check the logs for full command output.
Then I tried installing the protobuf compiler (sudo apt install protobuf-compiler) and now I get this other error, which seems to indicate that some script in the installation process requires a python binary. Since this is Ubuntu 20.04, no python 2.7 is installed and no python binary exists.
sudo pip3 install 'onnx>=1.1.2'
Collecting onnx>=1.1.2
Using cached onnx-1.6.0.tar.gz (3.1 MB)
Requirement already satisfied: numpy in /usr/local/lib/python3.8/dist-packages (from onnx>=1.1.2) (1.18.3)
Requirement already satisfied: protobuf in /usr/lib/python3/dist-packages (from onnx>=1.1.2) (3.6.1)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from onnx>=1.1.2) (1.14.0)
Requirement already satisfied: typing-extensions>=3.6.2.1 in /usr/local/lib/python3.8/dist-packages (from onnx>=1.1.2) (3.7.4.2)
Building wheels for collected packages: onnx
Building wheel for onnx (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t7al85w7/onnx/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t7al85w7/onnx/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-30aavuu6
cwd: /tmp/pip-install-t7al85w7/onnx/
Complete output (135 lines):
fatal: not a git repository (or any of the parent directories): .git
running bdist_wheel
running build
running build_py
running create_version
running cmake_build
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.so;-lpthread (found version "3.6.1")
Generated: /tmp/pip-install-t7al85w7/onnx/.setuptools-cmake-build/onnx/onnx-ml.proto
Generated: /tmp/pip-install-t7al85w7/onnx/.setuptools-cmake-build/onnx/onnx-operators-ml.proto
CMake Warning at CMakeLists.txt:394 (find_package):
By not providing "Findpybind11.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "pybind11",
but CMake did not find one.
Could not find a package configuration file provided by "pybind11"
(requested version 2.2) with any of the following names:
pybind11Config.cmake
pybind11-config.cmake
Add the installation prefix of "pybind11" to CMAKE_PREFIX_PATH or set
"pybind11_DIR" to a directory containing one of the above files. If
"pybind11" provides a separate development package or SDK, be sure it has
been installed.
--
-- ******** Summary ********
-- CMake version : 3.16.3
-- CMake command : /usr/bin/cmake
-- System : Linux
-- C++ compiler : /usr/bin/c++
-- C++ compiler version : 9.3.0
-- CXX flags : -Wnon-virtual-dtor
-- Build type : Release
-- Compile definitions :
-- CMAKE_PREFIX_PATH :
-- CMAKE_INSTALL_PREFIX : /usr/local
-- CMAKE_MODULE_PATH :
--
-- ONNX version : 1.6.0
-- ONNX NAMESPACE : onnx
-- ONNX_BUILD_TESTS : OFF
-- ONNX_BUILD_BENCHMARKS : OFF
-- ONNX_USE_LITE_PROTO : OFF
-- ONNXIFI_DUMMY_BACKEND : OFF
-- ONNXIFI_ENABLE_EXT : OFF
--
-- Protobuf compiler : /usr/bin/protoc
-- Protobuf includes : /usr/include
-- Protobuf libraries : /usr/lib/x86_64-linux-gnu/libprotobuf.so;-lpthread
-- BUILD_ONNX_PYTHON : ON
-- Python version :
-- Python executable : /usr/bin/python3
-- Python includes : /usr/include/python3.8
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/pip-install-t7al85w7/onnx/.setuptools-cmake-build
Scanning dependencies of target gen_onnx_proto
Scanning dependencies of target onnxifi_loader
Scanning dependencies of target onnxifi_dummy
[ 1%] Building C object CMakeFiles/onnxifi_dummy.dir/onnx/onnxifi_dummy.c.o
[ 3%] Building C object CMakeFiles/onnxifi_loader.dir/onnx/onnxifi_loader.c.o
[ 4%] Running gen_proto.py on onnx/onnx.in.proto
/tmp/pip-install-t7al85w7/onnx/onnx/onnxifi_dummy.c: In function ‘onnxGetExtensionFunctionAddress’:
/tmp/pip-install-t7al85w7/onnx/onnx/onnxifi_dummy.c:173:21: warning: assignment to ‘onnxExtensionFunctionPointer’ {aka ‘int (*)(void)’} from incompatible pointer type ‘onnxStatus (*)(void *, const char *, onnxStatus (**)(void))’ {aka ‘int (*)(void *, const char *, int (**)(void))’} [-Wincompatible-pointer-types]
173 | *function = &onnxGetExtensionFunctionAddress;
| ^
/tmp/pip-install-t7al85w7/onnx/onnx/onnxifi_dummy.c:176:21: warning: assignment to ‘onnxExtensionFunctionPointer’ {aka ‘int (*)(void)’} from incompatible pointer type ‘onnxStatus (*)(void *, uint32_t, const onnxTensorDescriptorV1 *, uint32_t, const onnxTensorDescriptorV1 *, onnxMemoryFenceV1 *)’ {aka ‘int (*)(void *, unsigned int, const struct onnxTensorDescriptorV1 *, unsigned int, const struct onnxTensorDescriptorV1 *, struct onnxMemoryFenceV1 *)’} [-Wincompatible-pointer-types]
176 | *function = &onnxSetIOAndRunGraph;
| ^
Processing /tmp/pip-install-t7al85w7/onnx/onnx/onnx.in.proto
Writing /tmp/pip-install-t7al85w7/onnx/.setuptools-cmake-build/onnx/onnx-ml.proto
Writing /tmp/pip-install-t7al85w7/onnx/.setuptools-cmake-build/onnx/onnx-ml.proto3
generating /tmp/pip-install-t7al85w7/onnx/.setuptools-cmake-build/onnx/onnx_pb.py
[ 6%] Running C++ protocol buffer compiler on /tmp/pip-install-t7al85w7/onnx/.setuptools-cmake-build/onnx/onnx-ml.proto
[ 8%] Linking C static library libonnxifi_loader.a
/usr/bin/env: ‘python’: No such file or directory
--mypy_out: protoc-gen-mypy: Plugin failed with status code 127.
make[2]: *** [CMakeFiles/gen_onnx_proto.dir/build.make:62: onnx/onnx-ml.pb.cc] Error 1
make[1]: *** [CMakeFiles/Makefile2:250: CMakeFiles/gen_onnx_proto.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 9%] Linking C shared library libonnxifi_dummy.so
[ 9%] Built target onnxifi_loader
[ 9%] Built target onnxifi_dummy
make: *** [Makefile:130: all] Error 2
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-t7al85w7/onnx/setup.py", line 315, in <module>
setuptools.setup(
File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.8/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 223, in run
self.run_command('build')
File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/lib/python3.8/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/tmp/pip-install-t7al85w7/onnx/setup.py", line 209, in run
self.run_command('cmake_build')
File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/tmp/pip-install-t7al85w7/onnx/setup.py", line 203, in run
subprocess.check_call(build_args)
File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/cmake', '--build', '.', '--', '-j', '12']' returned non-zero exit status 2.
----------------------------------------
ERROR: Failed building wheel for onnx
Running setup.py clean for onnx
Failed to build onnx
Installing collected packages: onnx
Running setup.py install for onnx ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t7al85w7/onnx/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t7al85w7/onnx/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-b60n_z7m/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/onnx
cwd: /tmp/pip-install-t7al85w7/onnx/
Complete output (107 lines):
fatal: not a git repository (or any of the parent directories): .git
running install
running build
running build_py
running create_version
running cmake_build
Generated: /tmp/pip-install-t7al85w7/onnx/.setuptools-cmake-build/onnx/onnx-ml.proto
Generated: /tmp/pip-install-t7al85w7/onnx/.setuptools-cmake-build/onnx/onnx-operators-ml.proto
CMake Warning at CMakeLists.txt:394 (find_package):
By not providing "Findpybind11.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "pybind11",
but CMake did not find one.
Could not find a package configuration file provided by "pybind11"
(requested version 2.2) with any of the following names:
pybind11Config.cmake
pybind11-config.cmake
Add the installation prefix of "pybind11" to CMAKE_PREFIX_PATH or set
"pybind11_DIR" to a directory containing one of the above files. If
"pybind11" provides a separate development package or SDK, be sure it has
been installed.
--
-- ******** Summary ********
-- CMake version : 3.16.3
-- CMake command : /usr/bin/cmake
-- System : Linux
-- C++ compiler : /usr/bin/c++
-- C++ compiler version : 9.3.0
-- CXX flags : -Wnon-virtual-dtor
-- Build type : Release
-- Compile definitions :
-- CMAKE_PREFIX_PATH :
-- CMAKE_INSTALL_PREFIX : /usr/local
-- CMAKE_MODULE_PATH :
--
-- ONNX version : 1.6.0
-- ONNX NAMESPACE : onnx
-- ONNX_BUILD_TESTS : OFF
-- ONNX_BUILD_BENCHMARKS : OFF
-- ONNX_USE_LITE_PROTO : OFF
-- ONNXIFI_DUMMY_BACKEND : OFF
-- ONNXIFI_ENABLE_EXT : OFF
--
-- Protobuf compiler : /usr/bin/protoc
-- Protobuf includes : /usr/include
-- Protobuf libraries : /usr/lib/x86_64-linux-gnu/libprotobuf.so;-lpthread
-- BUILD_ONNX_PYTHON : ON
-- Python version :
-- Python executable : /usr/bin/python3
-- Python includes : /usr/include/python3.8
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/pip-install-t7al85w7/onnx/.setuptools-cmake-build
[ 1%] Running C++ protocol buffer compiler on /tmp/pip-install-t7al85w7/onnx/.setuptools-cmake-build/onnx/onnx-ml.proto
[ 4%] Built target onnxifi_dummy
[ 8%] Built target onnxifi_loader
Scanning dependencies of target onnxifi_wrapper
/usr/bin/env: ‘python’: No such file or directory
--mypy_out: protoc-gen-mypy: Plugin failed with status code 127.
make[2]: *** [CMakeFiles/gen_onnx_proto.dir/build.make:62: onnx/onnx-ml.pb.cc] Error 1
make[1]: *** [CMakeFiles/Makefile2:250: CMakeFiles/gen_onnx_proto.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 9%] Building C object CMakeFiles/onnxifi_wrapper.dir/onnx/onnxifi_wrapper.c.o
[ 11%] Linking C shared module libonnxifi.so
[ 11%] Built target onnxifi_wrapper
make: *** [Makefile:130: all] Error 2
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-t7al85w7/onnx/setup.py", line 315, in <module>
setuptools.setup(
File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.8/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/usr/lib/python3.8/distutils/command/install.py", line 589, in run
self.run_command('build')
File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/lib/python3.8/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/tmp/pip-install-t7al85w7/onnx/setup.py", line 209, in run
self.run_command('cmake_build')
File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/tmp/pip-install-t7al85w7/onnx/setup.py", line 203, in run
subprocess.check_call(build_args)
File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/cmake', '--build', '.', '--', '-j', '12']' returned non-zero exit status 2.
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t7al85w7/onnx/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t7al85w7/onnx/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-b60n_z7m/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/onnx Check the logs for full command output.
To circumvent this issue a symbolic link can be made so that the python command actually runs python3.
In summary, to install onnx successfully in Ubuntu 20.04, you'll need to:
1) Install protobuf-compiler: sudo apt install protobuf-compiler
2) Make a link from python3 to python: sudo ln -s /usr/bin/python3 /usr/bin/python
Note: Maybe I missed another dependency, I already installed a bunch of other packages while installing the OpenVINO dependencies.
Just validated the tips from tgonzaleza on Ubuntu 18.04.
After this fix, below error was displayed:
Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR)
Can be fixed with this:
sudo apt-get install libprotobuf-dev
In summary, to install onnx successfully in Ubuntu 20.04, you'll need to install this version of onnx
pip install onnx==1.4.1
goodluck

Unable to install nlopt python package

I am trying to install python package Nlopt, which is a requirement for Semi-Supervised learning package semisup-learn. But getting this error in the command line. I checked other installing issues with Nlopt, but I didn't find the solution for this. In its Github nobody has raised this issue, so it looks like something is wrong with my computer side. Could anybody tell me what this error means and how to fix?
My python version: 3.6.8
MakotonoMacBook-ea:site-packages makotomiyazaki$ pip install nlopt
Collecting nlopt
Using cached https://files.pythonhosted.org/packages/7f/4f/de7e64a295e86c9f1ee382076019e0526247969353eb29345da1a05854b6/nlopt-2.4.2.post2.tar.gz
Requirement already satisfied: numpy in /Users/makotomiyazaki/anaconda3/lib/python3.6/site-packages (from nlopt) (1.16.4)
Building wheels for collected packages: nlopt
Building wheel for nlopt (setup.py) ... error
ERROR: Complete output from command /Users/makotomiyazaki/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/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/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-wheel-m3pr939i --python-tag cp36:
ERROR: running bdist_wheel
running build
running build_ext /private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/configure --prefix=/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/temp.macosx-10.7-x86_64-3.6 --libdir=/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/lib.macosx-10.7-x86_64-3.6 --enable-shared --without-guile --without-octave --without-matlab
extdir: /private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/lib.macosx-10.7-x86_64-3.6
build_temp: build/temp.macosx-10.7-x86_64-3.6
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... no
checking whether make supports nested variables... no
checking whether to enable maintainer-specific portions of
Makefiles... no
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/temp.macosx-10.7-x86_64-3.6':
configure: error: C compiler cannot create executables
See `config.log' for more details
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/setup.py", line 124, in <module>
'Programming Language :: Python :: 3'
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 179, in run
self.run_command('build')
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/setup.py", line 37, in run
self.build_extension(ext)
File "/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/setup.py", line 66, in build_extension
subprocess.check_call(config_cmd, cwd=self.build_temp, env=os.environ)
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/configure', '--prefix=/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/temp.macosx-10.7-x86_64-3.6', '--libdir=/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/lib.macosx-10.7-x86_64-3.6', '--enable-shared', '--without-guile', '--without-octave', '--without-matlab']' returned non-zero exit status 77.
ERROR: Failed building wheel for nlopt
Running setup.py clean for nlopt
Failed to build nlopt
Installing collected packages: nlopt
Running setup.py install for nlopt ... error
ERROR: Complete output from command
/Users/makotomiyazaki/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/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/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-record-gzrc6abe/install-record.txt --single-version-externally-managed --compile:
ERROR: running install
running build
running build_ext
/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/configure --prefix=/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/temp.macosx-10.7-x86_64-3.6 --libdir=/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/lib.macosx-10.7-x86_64-3.6 --enable-shared --without-guile --without-octave --without-matlab
extdir: /private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/lib.macosx-10.7-x86_64-3.6
build_temp: build/temp.macosx-10.7-x86_64-3.6
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... no
checking whether make supports nested variables... no
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/temp.macosx-10.7-x86_64-3.6':
configure: error: C compiler cannot create executables
See `config.log' for more details
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/setup.py", line 124, in <module>
'Programming Language :: Python :: 3'
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/command/install.py", line 545, in run
self.run_command('build')
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/setup.py", line 37, in run
self.build_extension(ext)
File "/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/setup.py", line 66, in build_extension
subprocess.check_call(config_cmd, cwd=self.build_temp, env=os.environ)
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/configure', '--prefix=/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/temp.macosx-10.7-x86_64-3.6', '--libdir=/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/lib.macosx-10.7-x86_64-3.6', '--enable-shared', '--without-guile', '--without-octave', '--without-matlab']' returned non-zero exit status 77.
----------------------------------------
ERROR: Command "/Users/makotomiyazaki/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/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/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-record-gzrc6abe/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/

Error installing python simple-crypt on RHEL 6

I get an error when I try to install the simple-crypt package on RHEL 6 (pip3.6 install simple-crypt). Error code below:
running build_ext
running build_configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/tmp/pip-build-a43nvnvj/pycrypto':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-a43nvnvj/pycrypto/setup.py", line 456, in <module>
core.setup(**kw)
File "/usr/lib64/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib64/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/usr/lib64/python3.6/distutils/command/install.py", line 545, in run
self.run_command('build')
File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib64/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-build-a43nvnvj/pycrypto/setup.py", line 251, in run
self.run_command(cmd_name)
File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-build-a43nvnvj/pycrypto/setup.py", line 278, in run
raise RuntimeError("autoconf error")
RuntimeError: autoconf error
----------------------------------------
Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-a43nvnvj/pycrypto/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-0i_6q6fm-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-a43nvnvj/pycrypto/
From what I can tell, the issue is with GCC. When I try to install python-ldap I get a "gcc failed with exit status 1" error. Currently, the server I am working on is running gcc 4.4.7, so I am not sure if I need to update it or not. I have limited experience working with RHEL, so I'm not sure where to go from here. Any advice would be appreciated.
After some digging around I found that it was due to the /tmp directory which pip uses having the noexec flag. As a solution I did mount -o remount,exec /tmp and when I was done mount -o remount,noexec /tmp to revert it to its original settings. After removing the noexec flag the package installed just fine.

Installing cython on windows 7, python 3.4.3 with pip

I try to install cython on windows 7 64bit ( Python 3.4.3 ) via
pip install cython
and ends with the error message
error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).
Which I find kinda strange since I have visual studio community 2013 installed.
When I ask windows where vcvarsall.bat is it kindly answers me
C:\Users\me>where vcvarsall.bat
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat
So it is in my path. Do I need a different visual studio version and with that a different version of vcvarsall.bat?
Edit 1
I downloaded the VS2010 ISO SonicARG provided. Thank you.
Now cython acknowledges the compiler, but still fails to install.
pip install cython
Running setup.py install for cython
Complete output from command C:\Python34\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\me\\AppData\\Local\\Temp\\pip-build-12j3y7gp\\cython\\setup.py';exec(compile(getattr(t
okenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\me\AppData\Local\Temp\pip-lgya62cy-record\install-record.txt --single-version-external
ly-managed --compile:
Unable to find pgen, not compiling formal grammar.
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.4
copying cython.py -> build\lib.win-amd64-3.4
creating build\lib.win-amd64-3.4\Cython
copying Cython\CodeWriter.py -> build\lib.win-amd64-3.4\Cython
[Many lines of copying and creating]
copying Cython\Debugger\Tests\cfuncs.c -> build\lib.win-amd64-3.4\Cython\Debugger\Tests
running build_ext
cythoning C:\Users\me\AppData\Local\Temp\pip-build-12j3y7gp\cython\Cython\Plex\Scanners.py to C:\Users\me\AppData\Local\Temp\pip-build-12j3y7gp\cython\Cython\Plex\Scanners.c
building 'Cython.Plex.Scanners' extension
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\me\AppData\Local\Temp\pip-build-12j3y7gp\cython\setup.py", line 357, in <module>
**setup_args
File "C:\Python34\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Python34\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Python34\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Python34\lib\distutils\command\install.py", line 539, in run
self.run_command('build')
File "C:\Python34\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Python34\lib\distutils\command\build.py", line 126, in run
self.run_command(cmd_name)
File "C:\Python34\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\me\AppData\Local\Temp\pip-build-12j3y7gp\cython\Cython\Distutils\build_ext.py", line 164, in run
_build_ext.build_ext.run(self)
File "C:\Python34\lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "C:\Users\me\AppData\Local\Temp\pip-build-12j3y7gp\cython\setup.py", line 192, in build_extensions
build_ext_orig.build_extensions(self)
File "C:\Users\me\AppData\Local\Temp\pip-build-12j3y7gp\cython\Cython\Distutils\build_ext.py", line 172, in build_extensions
self.build_extension(ext)
File "C:\Python34\lib\distutils\command\build_ext.py", line 503, in build_extension
depends=ext.depends)
File "C:\Python34\lib\distutils\msvc9compiler.py", line 460, in compile
self.initialize()
File "C:\Python34\lib\distutils\msvc9compiler.py", line 371, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Python34\lib\site-packages\setuptools\msvc9_support.py", line 52, in query_vcvarsall
return unpatched['query_vcvarsall'](version, *args, **kwargs)
File "C:\Python34\lib\distutils\msvc9compiler.py", line 287, in query_vcvarsall
raise ValueError(str(list(result.keys())))
ValueError: ['path']
----------------------------------------
Command "C:\Python34\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\me\\AppData\\Local\\Temp\\pip-build-12j3y7gp\\cython\\setup.py';exec(compile(getattr(tokenize, 'open', open)(_
_file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\me\AppData\Local\Temp\pip-lgya62cy-record\install-record.txt --single-version-externally-managed --compile" fa
iled with error code 1 in C:\Users\me\AppData\Local\Temp\pip-build-12j3y7gp\cython
Python 3.4 is built against Microsoft's Visual Studio 2010; in order to build native modules you must use the exact version. You can just download the Express Edition to build them, the entire IDE is not necessary. You can fetch the VS2010 ISO from here, and install the C++ component, then try again.
Note for future: If you plan to upgrade Python to 3.5 (release date is September 13, 2015), the Visual Studio version will be 2015, so you can be ready if you have the save problem

Resources