spaCy installation error during cythonisation - python

I am trying to compile spaCy on a macOS Sierra. I just installed XCode and my gcc --version shows this:
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Installing the requirements works fine, but running python setup.py build_ext --inplace gives me this error:
Obtaining file://~/code/spaCy
Complete output from command python setup.py egg_info:
[Errno 2] No such file or directory: '~/code/spaCy/spacy/cfile.pyx'
Processing cfile.pyx
Traceback (most recent call last):
File "~/code/spaCy/bin/cythonize.py", line 157, in <module>
run(args.root)
File "~/code/spaCy/bin/cythonize.py", line 148, in run
process(base, filename, db)
File "~/code/spaCy/bin/cythonize.py", line 114, in process
preserve_cwd(base, process_pyx, root + '.pyx', root + '.cpp')
File "~/code/spaCy/bin/cythonize.py", line 79, in preserve_cwd
func(*args)
File "~/code/spaCy/bin/cythonize.py", line 61, in process_pyx
raise Exception('Cython failed')
Exception: Cython failed
Cythonizing sources
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "~/code/spaCy/setup.py", line 227, in <module>
setup_package()
File "~/code/spaCy/setup.py", line 172, in setup_package
generate_cython(root, 'spacy')
File "~/code/spaCy/setup.py", line 104, in generate_cython
raise RuntimeError('Running cythonize failed')
RuntimeError: Running cythonize failed
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in ~/code/spaCy/
Is there an easy way to debug this? Or am I missing some configuration step?

Related

Python3 Subprocess Exited with Error (pyproject.toml)

I'm installing this package https://github.com/fuzailpalnak/kaizen, with this command:
pip3 install kaizen-mapping
but I'm getting this error. I've looked up online from many sites have a similar error, which seems to suggest that the root of the error is likely in the python version or in pip. Anyone knows how I can resolve this issue? Thanks!
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [45 lines of output]
Error in sitecustomize; set PYTHONVERBOSE for traceback:
AssertionError:
Running from numpy source directory.
<string>:470: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
Error in sitecustomize; set PYTHONVERBOSE for traceback:
AssertionError:
Processing numpy/random/_bounded_integers.pxd.in
Processing numpy/random/_philox.pyx
Traceback (most recent call last):
File "/private/var/folders/3g/6bwtmr4x4m3dvzm2dwby16q40000gn/T/pip-install-m94k6wqb/numpy/tools/cythonize.py", line 59, in process_pyx
from Cython.Compiler.Version import version as cython_version
ModuleNotFoundError: No module named 'Cython'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/private/var/folders/3g/6bwtmr4x4m3dvzm2dwby16q40000gn/T/pip-install-m94k6wqb/numpy/tools/cythonize.py", line 235, in <module>
main()
File "/private/var/folders/3g/6bwtmr4x4m3dvzm2dwby16q40000gn/T/pip-install-m94k6wqb/numpy/tools/cythonize.py", line 231, in main
find_process_files(root_dir)
File "/private/var/folders/3g/6bwtmr4x4m3dvzm2dwby16q40000gn/T/pip-install-m94k6wqb/numpy/tools/cythonize.py", line 222, in find_process_files
process(root_dir, fromfile, tofile, function, hash_db)
File "/private/var/folders/3g/6bwtmr4x4m3dvzm2dwby16q40000gn/T/pip-install-m94k6wqb/numpy/tools/cythonize.py", line 188, in process
processor_function(fromfile, tofile)
File "/private/var/folders/3g/6bwtmr4x4m3dvzm2dwby16q40000gn/T/pip-install-m94k6wqb/numpy/tools/cythonize.py", line 64, in process_pyx
raise OSError('Cython needs to be installed in Python as a module')
OSError: Cython needs to be installed in Python as a module
Cythonizing sources
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/opt/homebrew/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/opt/homebrew/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 164, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
File "/opt/homebrew/Cellar/python#3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/build_meta.py", line 188, in prepare_metadata_for_build_wheel
self.run_setup()
File "/opt/homebrew/Cellar/python#3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/build_meta.py", line 281, in run_setup
super(_BuildMetaLegacyBackend,
File "/opt/homebrew/Cellar/python#3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/build_meta.py", line 174, in run_setup
exec(code, locals())
File "<string>", line 499, in <module>
File "<string>", line 479, in setup_package
File "<string>", line 274, in generate_cython
RuntimeError: Running cythonize failed!
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> numpy
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
P.S. Another thing I tried was installing it with this as I saw it from another Stackoverflow site that this is how they resolved it but the same error:
pip3 install kaizen-mapping --use-deprecated=legacy-resolver
You has not installed Cython -- This is clearly written in there:
Traceback (most recent call last):
...
OSError: Cython needs to be installed in Python as a module
You can try pip install cython and try it again.

When Installing polyglot with pip exception: Command "python setup.py egg_info" failed with error code 1 in

I am trying to install polyglot. I run Windows10 and have installed python3 using Anaconda3.
I have updated the setuptools.
The command and the error message are the following:
(base) C:\Users\Alienware\Documents>pip install -U git+https://github.com/aboSamoor/polyglot.git#master
Collecting git+https://github.com/aboSamoor/polyglot.git#master
Cloning https://github.com/aboSamoor/polyglot.git (to revision master) to c:\users\alienw~1\appdata\local\temp\pip-req-build-qt6pounr
Collecting PyICU>=1.8 (from polyglot==16.7.4)
Downloading https://files.pythonhosted.org/packages/c2/15/0af20b540c828943b6ffea5677c86e908dcac108813b522adebb75c827c1/PyICU-2.2.tar.gz (211kB)
100% |████████████████████████████████| 215kB 789kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "C:\Users\ALIENW~1\AppData\Local\Temp\pip-install-8fgenlih\PyICU\setup.py", line 43, in <module>
ICU_VERSION = os.environ['ICU_VERSION']
File "c:\programdata\anaconda3\lib\os.py", line 669, in __getitem__
raise KeyError(key) from None
KeyError: 'ICU_VERSION'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\ALIENW~1\AppData\Local\Temp\pip-install-8fgenlih\PyICU\setup.py", line 46, in <module>
ICU_VERSION = check_output(('icu-config', '--version')).strip()
File "c:\programdata\anaconda3\lib\subprocess.py", line 336, in check_output
**kwargs).stdout
File "c:\programdata\anaconda3\lib\subprocess.py", line 403, in run
with Popen(*popenargs, **kwargs) as process:
File "c:\programdata\anaconda3\lib\subprocess.py", line 707, in __init__
restore_signals, start_new_session)
File "c:\programdata\anaconda3\lib\subprocess.py", line 992, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\ALIENW~1\AppData\Local\Temp\pip-install-8fgenlih\PyICU\setup.py", line 53, in <module>
''')
RuntimeError:
Please set the ICU_VERSION environment variable to the version of
ICU you have installed.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\ALIENW~1\AppData\Local\Temp\pip-install-8fgenlih\PyICU\

"python setup.py egg_info" error for pyproj package but not others

I've been trying to install the pyproj python package (I want to use the stateplane part specifically). Long story short.. I have a csv of lat, long, and a variable value and wanted to extract data for each state. I was going to use the
stateplane.identify(-80.1, 36.2, fmt='short')
feature to identify the state. I have verified that I have python 3.6.3 and pip 9.0.1. Doing pip install worked for the libusb package, but I'm getting an error when I do
pip install pyproj
Collecting pyproj
Using cached pyproj-1.9.5.1.tar.gz
Complete output from command python setup.py egg_info:
using bundled proj4..
Traceback (most recent call last):
File "c:\python36-32\lib\site-packages\setuptools\msvc.py", line 490, in _
find_latest_available_vc_ver
return self.find_available_vc_vers()[-1]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\smshp\AppData\Local\Temp\pip-build-_bzisu0o\pyproj\setup.py
", line 72, in <module>
objects = cc.compile(['nad2bin.c', 'src/pj_malloc.c'])
File "c:\python36-32\lib\distutils\_msvccompiler.py", line 345, in compile
self.initialize()
File "c:\python36-32\lib\distutils\_msvccompiler.py", line 238, in initial
ize
vc_env = _get_vc_env(plat_spec)
File "c:\python36-32\lib\site-packages\setuptools\msvc.py", line 185, in m
svc14_get_vc_env
return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env()
File "c:\python36-32\lib\site-packages\setuptools\msvc.py", line 844, in _
_init__
self.si = SystemInfo(self.ri, vc_ver)
File "c:\python36-32\lib\site-packages\setuptools\msvc.py", line 486, in _
_init__
self.vc_ver = vc_ver or self._find_latest_available_vc_ver()
File "c:\python36-32\lib\site-packages\setuptools\msvc.py", line 493, in _
find_latest_available_vc_ver
raise distutils.errors.DistutilsPlatformError(err)
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 is requir
ed. Get it with "Microsoft Visual C++ Build Tools":
http://landinghub.visualstud
io.com/visual-cpp-build-tools
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\smshp\Ap
pData\Local\Temp\pip-build-_bzisu0o\pyproj\
I have followed the troubleshooting tips from this post word to no avail.
Alternatively, if I downloaded the repo and did
python setup.py install
would I download the .whl or tar.gz file and would I download it to the python36-32 directory or where?
Thanks!

build sklearn error cythonize failed

$ sudo python setup.py build
Gives me the following:
Partial import of sklearn during the build process.
Generating cython files
Cythonizing sources
sklearn
Processing sklearn/_isotonic.pyx
Traceback (most recent call last):
File "/home/scikit-learn/build_tools/cythonize.py", line 198, in <module>
main(root_dir_arg)
File "/home/ascikit-learn/build_tools/cythonize.py", line 190, in main
check_and_cythonize(root_dir)
File "/home/scikit-learn/build_tools/cythonize.py", line 182, in check_and_cythonize
cythonize_if_unchanged(cur_dir, cython_file, gen_file, hashes)
File "/home/scikit-learn/build_tools/cythonize.py", line 156, in cythonize_if_unchanged
cythonize(full_cython_path, full_gen_file_path)
File "/home/scikit-learn/build_tools/cythonize.py", line 61, in cythonize
raise Exception('Building scikit-learn requires Cython >= 0.21')
Exception: Building scikit-learn requires Cython >= 0.21
Traceback (most recent call last):
File "setup.py", line 297, in <module>
setup_package()
File "setup.py", line 280, in setup_package
generate_cython()
File "setup.py", line 185, in generate_cython
raise RuntimeError("Running cythonize failed!")
RuntimeError: Running cythonize failed!
While cython is installed:
Processing ./Cython-0.24-cp27-cp27mu-manylinux1_x86_64.whl
Installing collected packages: Cython
Found existing installation: Cython 0.24
Uninstalling Cython-0.24:
Successfully uninstalled Cython-0.24
Successfully installed Cython-0.24

Trouble installing django-imagekit - 'execfile' is not defined

I am having problems installing django-imagekit under python 3.2/django 1.5. Is django-imagekit only for python 2 (then why is it available in pip-3.2)?
Trying to install django-imagekit from within my virtualenv.
------------------------------------------------------------
/home/testuser/webapps/app/bin/pip run on Tue Nov 19 10:38:45 2013
Downloading/unpacking django-imagekit
Running setup.py egg_info for package django-imagekit
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/testuser/webapps/app/build/django-imagekit/setup.py", line 25, in <module>
execfile(os.path.join(os.path.dirname(__file__),
NameError: name 'execfile' is not defined
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/testuser/webapps/app/build/django-imagekit/setup.py", line 25, in <module>
execfile(os.path.join(os.path.dirname(__file__),
NameError: name 'execfile' is not defined
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /home/testuser/webapps/app/build/django-imagekit
Exception information:
Traceback (most recent call last):
File "/home/testuser/webapps/app/lib/python3.2/site-packages/pip-1.1-py3.2.egg/pip/basecommand.py", line 104, in main
status = self.run(options, args)
File "/home/testuser/webapps/app/lib/python3.2/site-packages/pip-1.1-py3.2.egg/pip/commands/install.py", line 245, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/home/testuser/webapps/app/lib/python3.2/site-packages/pip-1.1-py3.2.egg/pip/req.py", line 1009, in prepare_files
req_to_install.run_egg_info()
File "/home/testuser/webapps/app/lib/python3.2/site-packages/pip-1.1-py3.2.egg/pip/req.py", line 225, in run_egg_info
req_to_install.run_egg_info()
File "/home/testuser/webapps/app/lib/python3.2/site-packages/pip-1.1-py3.2.egg/pip/req.py", line 225, in run_egg_info
command_desc='python setup.py egg_info')
File "/home/testuser/webapps/app/lib/python3.2/site-packages/pip-1.1-py3.2.egg/pip/__init__.py", line 256, in call_subprocess
% (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command python setup.py egg_info failed with error code 1 in /home/testuser/webapps/app/build/django-imagekit
It doesn't look like this module has been updated for python3 yet. Django has only officially supported python3 since 1.5, so several packages have yet to update.
I'm the maintainer of django-imagekit and, unfortunately, it isn't quite ready for Python 3 yet. As for why it's "available" for pip-3.2…My understanding is that pip doesn't do any filtering of packages based on the version of Python you're using; pip-3.2 is named that way because it installs packages into Python 3.2, but it doesn't use a separate index.
EDIT:
We just pushed ImageKit 3.2 which has support for Python 3! Give it a try (:

Categories

Resources