I'm getting the below mentioned bad marshal data error when installing my own created python package on Mac OS.
deveshs-MacBook-Pro:mycli devesh$ sudo python setup-4.0.py install
running install
Checking .pth file support in /Library/Python/2.7/site-packages/
/usr/bin/python -E -c pass
TEST PASSED: /Library/Python/2.7/site-packages/ appears to support .pth files
running bdist_egg
running egg_info
writing requirements to mycli.egg-info/requires.txt
writing cftcli.egg-info/PKG-INFO
writing top-level names to mycli.egg-info/top_level.txt
writing dependency_links to mycli.egg-info/dependency_links.txt
writing entry points to mycli.egg-info/entry_points.txt
reading manifest file 'mycli.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'mycli.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.10-intel/egg
running install_lib
running build_py
copying mycli.egg-info/PKG-INFO -> build/bdist.macosx-10.10-intel/egg/EGG-INFO
copying mycli.egg-info/SOURCES.txt -> build/bdist.macosx-10.10-intel/egg/EGG-INFO
copying mycli.egg-info/dependency_links.txt -> build/bdist.macosx-10.10-intel/egg/EGG-INFO
copying mycli.egg-info/entry_points.txt -> build/bdist.macosx-10.10-intel/egg/EGG-INFO
copying mycli.egg-info/requires.txt -> build/bdist.macosx-10.10-intel/egg/EGG-INFO
copying mycli.egg-info/top_level.txt -> build/bdist.macosx-10.10-intel/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
Traceback (most recent call last):
File "setup-4.0.py", line 42, in <module>
"requests==2.4.3",
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/Library/Python/2.7/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/Library/Python/2.7/site-packages/setuptools/command/install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/Library/Python/2.7/site-packages/setuptools/command/bdist_egg.py", line 208, in run
os.path.join(archive_root, 'EGG-INFO'), self.zip_safe()
File "/Library/Python/2.7/site-packages/setuptools/command/bdist_egg.py", line 244, in zip_safe
return analyze_egg(self.bdist_dir, self.stubs)
File "/Library/Python/2.7/site-packages/setuptools/command/bdist_egg.py", line 354, in analyze_egg
safe = scan_module(egg_dir, base, name, stubs) and safe
File "/Library/Python/2.7/site-packages/setuptools/command/bdist_egg.py", line 391, in scan_module
code = marshal.load(f)
ValueError: bad marshal data (unknown type code)
I tried deleting all the *.pyc files from the setuptools directory.
Please guide how this issue can be resolved.
Thanks.
First I thought that the issue is with the filename, which should be setup.py only, but it gave same error with sudo python setup.py install too.
A workaround I found out is to create a source-distribution first.
see documentation here
Below is the script which will work fine and put us out from the above issue.
cp -f setup-4.0.py setup.py
python setup.py sdist --format=zip,gztar
sudo pip install dist/mycli-4.0.tar.gz
rm setup.py
To uninstall: sudo pip uninstall mycli
Hope it will help some Mac users. Thanks.
Related
I try to install a python package. It's fitsio. I work on Jupyter Notebook but I am a beginner.
I try pip install fitsio but I have an error like you see :
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools>pip install fitsio
Collecting fitsio
Using cached fitsio-1.1.7.tar.gz (5.0 MB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in c:\users\utilisateur\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from fitsio) (1.21.6)
Using legacy 'setup.py install' for fitsio, since package 'wheel' is not installed.
Installing collected packages: fitsio
Running setup.py install for fitsio ... error
error: subprocess-exited-with-error
× Running setup.py install for fitsio did not run successfully.
│ exit code: 1
╰─> [64 lines of output]
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\fitsio
copying fitsio\fitslib.py -> build\lib.win-amd64-3.7\fitsio
copying fitsio\header.py -> build\lib.win-amd64-3.7\fitsio
copying fitsio\test.py -> build\lib.win-amd64-3.7\fitsio
copying fitsio\util.py -> build\lib.win-amd64-3.7\fitsio
copying fitsio\__init__.py -> build\lib.win-amd64-3.7\fitsio
creating build\lib.win-amd64-3.7\fitsio\hdu
copying fitsio\hdu\base.py -> build\lib.win-amd64-3.7\fitsio\hdu
copying fitsio\hdu\image.py -> build\lib.win-amd64-3.7\fitsio\hdu
copying fitsio\hdu\table.py -> build\lib.win-amd64-3.7\fitsio\hdu
copying fitsio\hdu\__init__.py -> build\lib.win-amd64-3.7\fitsio\hdu
running egg_info
writing fitsio.egg-info\PKG-INFO
writing dependency_links to fitsio.egg-info\dependency_links.txt
writing requirements to fitsio.egg-info\requires.txt
writing top-level names to fitsio.egg-info\top_level.txt
reading manifest file 'fitsio.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'fitsio.egg-info\SOURCES.txt'
copying fitsio\fitsio_pywrap.c -> build\lib.win-amd64-3.7\fitsio
creating build\lib.win-amd64-3.7\fitsio\test_images
copying fitsio\test_images\test_gzip_compressed_image.fits.fz -> build\lib.win-amd64-3.7\fitsio\test_images
running build_ext
Traceback (most recent call last):
File "<string>", line 36, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\UTILIS~1\AppData\Local\Temp\pip-install-pugpqzau\fitsio_302dc86b80ce48538f11d014b602f5f7\setup.py", line 284, in <module>
cmdclass={"build_ext": build_ext_subclass}
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\UTILIS~1\AppData\Local\Temp\pip-install-pugpqzau\fitsio_302dc86b80ce48538f11d014b602f5f7\setup.py", line 72, in run
build_ext.run(self)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\command\build_ext.py", line 87, in run
_build_ext.run(self)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\distutils\command\build_ext.py", line 340, in run
self.build_extensions()
File "C:\Users\UTILIS~1\AppData\Local\Temp\pip-install-pugpqzau\fitsio_302dc86b80ce48538f11d014b602f5f7\setup.py", line 80, in build_extensions
CCold = self.compiler.compiler
AttributeError: 'MSVCCompiler' object has no attribute 'compiler'
[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.
╰─> fitsio
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
To resolve my problem I try to update python -m pip install –upgrade pip & pip install –upgrade wheel & pip install –upgrade setuptools.
Moreover I download Microsoft c++ build tools.
I install successfully cfitsio with Anaconda but when I write import cfitsio Jupyter notebook does not recognize the package.
Thanks for reading.
Check which kernel you have picked to ensure that your import statement corresponds to the respective Python environment and package installed via pip.
See VSCode issue with Python versions and environments from Jupyter Notebooks and https://github.com/microsoft/vscode-jupyter/issues/7373 for additional information.
As part of a script I am writing, I need to install the package autodock vina for the purpose of ligand and protein binding. Every time I attempt to "pip install vina", I recieve an error message " ValueError: Boost library location was not found!". Upon attempting to install boost manually, I have been unable to run the bootstrap file, as it does not make the b2 folder that online tutorials say it will make.
To resolve this issue, I installed conda, and made an active environment with every single prerequisite, including boost, installed. I have checked for the version of all of these prerequisites and confirmed their existence, as well as double and triple-checking that I am in the write active environment. Upon installation, I either get the same issue (using conda install vina) or when using "conda install -c bioconda autodock-vina", I get a message saying that the package does not exist (despite adding cforge and bioconda as active package handlers, and the existence of said package is clearly documented online). Does anyone have any suggestions? I've been attempting to install this piece of software for 3 days and I've completely exhausted the documentation, as well as all other similar question answers, with nothing working.
Full error message:
Collecting vina
Using cached vina-1.2.3.tar.gz (95 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [56 lines of output]
Version found 1.2.3 (from __init__.py)
running egg_info
creating vina.egg-info
writing vina.egg-info\PKG-INFO
writing dependency_links to vina.egg-info\dependency_links.txt
writing requirements to vina.egg-info\requires.txt
writing top-level names to vina.egg-info\top_level.txt
writing manifest file 'vina.egg-info\SOURCES.txt'
Boost library is not installed in this conda environment.
Traceback (most recent call last):
File "C:\Users\chris\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
main()
File "C:\Users\chris\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\chris\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 130, in get_requires_for_build_wheel
return hook(config_settings)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\build_meta.py", line 177, in get_requires_for_build_wheel
return self._get_build_requires(
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\build_meta.py", line 159, in _get_build_requires
self.run_setup()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\build_meta.py", line 174, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 346, in <module>
setup(
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 148, in setup
return run_commands(dist)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 163, in run_commands
dist.run_commands()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 967, in run_commands
self.run_command(cmd)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\dist.py", line 1214, in run_command
super().run_command(command)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
cmd_obj.run()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 308, in run
self.find_sources()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 315, in find_sources
mm.run()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 550, in run
self.add_defaults()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 587, in add_defaults
sdist.add_defaults(self)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 228, in add_defaults
self._add_defaults_ext()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 311, in _add_defaults_ext
build_ext = self.get_finalized_command('build_ext')
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 299, in get_finalized_command
cmd_obj.ensure_finalized()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "setup.py", line 247, in finalize_options
raise ValueError(error_msg)
ValueError: Boost library location was not found!
Directories searched: conda env, /usr/local/include and /usr/include.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
I also get this error. I asked ResearchGate how to solve this problem and Cheng Shen adviced to use WSL/WSL2 to simulate a Linux environment and then run conda install -c bioconda vina (or another command like this)
What I did.
Install WSL and Ubuntu on Windows 2. Run code . in WSL terminal (for installing VS Code [recommended])
Install Anaconda/Miniconda following this guide
Type conda install -c bioconda vina in Ubuntu terminal (bioconda channel will download all required packages - boost, swig, etc.)
Vina should be successfully installed ( vina --version in WSL Terminal to check)
I found it much easier to install packages for docking via WSL and use VS Code to run scripts there. It's VERY easier than trying to solve this problem by configuring boost for Windows. If you have any questions you can ask me in ResearchGate.
I'm trying to install Autodock Vina with pip command. But when I run the command pip install -U numpy vina: I get a the following error:
Collecting vina
Using cached vina-1.2.3.tar.gz (95 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [52 lines of output]
Version found 1.2.3 (from __init__.py)
running egg_info
writing vina.egg-info\PKG-INFO
writing dependency_links to vina.egg-info\dependency_links.txt
writing requirements to vina.egg-info\requires.txt
writing top-level names to vina.egg-info\top_level.txt
Boost library is not installed in this conda environment.
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
main()
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 130, in get_requires_for_build_wheel
return hook(config_settings)
File "C:\Users\Familia\AppData\Local\Temp\pip-build-env-km4q58s5\overlay\Lib\site-packages\setuptools\build_meta.py", line 162, in get_requires_for_build_wheel
return self._get_build_requires(
File "C:\Users\Familia\AppData\Local\Temp\pip-build-env-km4q58s5\overlay\Lib\site-packages\setuptools\build_meta.py", line 143, in _get_build_requires
self.run_setup()
File "C:\Users\Familia\AppData\Local\Temp\pip-build-env-km4q58s5\overlay\Lib\site-packages\setuptools\build_meta.py", line 158, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 346, in <module>
setup(
File "C:\Users\Familia\AppData\Local\Temp\pip-build-env-km4q58s5\overlay\Lib\site-packages\setuptools\__init__.py", line 155, in setup
return distutils.core.setup(**attrs)
File "C:\Users\Familia\AppData\Local\Temp\pip-build-env-km4q58s5\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 148, in setup
return run_commands(dist)
File "C:\Users\Familia\AppData\Local\Temp\pip-build-env-km4q58s5\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 163, in run_commands
dist.run_commands()
File "C:\Users\Familia\AppData\Local\Temp\pip-build-env-km4q58s5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 967, in run_commands
self.run_command(cmd)
File "C:\Users\Familia\AppData\Local\Temp\pip-build-env-km4q58s5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
cmd_obj.run()
File "C:\Users\Familia\AppData\Local\Temp\pip-build-env-km4q58s5\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 299, in run
self.find_sources()
File "C:\Users\Familia\AppData\Local\Temp\pip-build-env-km4q58s5\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 306, in find_sources
mm.run()
File "C:\Users\Familia\AppData\Local\Temp\pip-build-env-km4q58s5\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 541, in run
self.add_defaults()
File "C:\Users\Familia\AppData\Local\Temp\pip-build-env-km4q58s5\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 578, in add_defaults
sdist.add_defaults(self)
File "C:\Users\Familia\AppData\Local\Temp\pip-build-env-km4q58s5\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 228, in add_defaults
self._add_defaults_ext()
File "C:\Users\Familia\AppData\Local\Temp\pip-build-env-km4q58s5\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 311, in _add_defaults_ext
build_ext = self.get_finalized_command('build_ext')
File "C:\Users\Familia\AppData\Local\Temp\pip-build-env-km4q58s5\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 299, in get_finalized_command
cmd_obj.ensure_finalized()
File "C:\Users\Familia\AppData\Local\Temp\pip-build-env-km4q58s5\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "setup.py", line 247, in finalize_options
raise ValueError(error_msg)
ValueError: Boost library location was not found!
Directories searched: conda env, /usr/local/include and /usr/include.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
I have had a similar issue and fixed it by installing boost and swig libraries. Unfortunately, I do not completely know how to do that on Windows, but the rough sketch of what you should do is:
Locate your active conda environment. If there are none, create and activate one before installing your project dependencies. To get to know the location of your environment, use conda info. For more, see this stackoverflow thread.
Download boost and swig as archives from these links to their official website.
Unpack the archives into the conda environment folder.
Try installing again (make sure you have activated the environment) pip install -U numpy vina.
For the Linux and MacOS users that may have the same issue, the solution is very similar, except that you do not have to activate a conda environment. Instead, you can install boost and swig globally in your system, as described in this guide in the autodock-vina website.
Install C++ compiler.
Ubuntu/Debian: sudo apt-get install build-essentials
macOS: Install Xcode from the AppStore and the Command Line Tools (CLT) from the terminal xcode-select --install
Install boost and swig in your system
Ubuntu/Debian: sudo apt-get install libboost-all-dev swig
macOS (with Homebrew): brew install boost swig
I found a numpy extension on github that would be really helpful for a program I'm currently writting, however I don't know how to install it.
Here's the link to the extension: https://pypi.python.org/pypi?name=py_find_1st&:action=display
I'm using windows 10 which might be the reason why the installer provided doesn't work, I found a file looking like a numpy extension as described here: https://docs.scipy.org/doc/numpy-1.10.0/user/c-info.how-to-extend.html
But there's no mention on this page of where to put the code of the numpy extension, and I didn't manage to find any explanations online.
Would anyone have an idea on how to install this?
To build any extension modules for Python, you’ll need a C compiler. Various NumPy modules use FORTRAN 77 libraries, so you’ll also need a FORTRAN 77 compiler installed.
However, if you just want to install the tar.gz file that they have on the website, follow these steps:
Open cmd (Command Prompt)
Write set path=%path%;C:\Python27\
Extract the tar.gz file (use a program like PeaZip)
Change directories within the command line (if you are confused on how to do this look here for reference)
Get to your files' directory (something like cd c:\Users\pdxNat\Downloads\py_find_1st1.0.6)
Run python setup.py install
Error message when trying to install the extension using the cmd:
D:\Chrome dl\py_find_1st-1.0.6\py_find_1st-1.0.6>python setup.py install
running install
running bdist_egg
running egg_info
creating py_find_1st.egg-info
writing py_find_1st.egg-info\PKG-INFO
writing dependency_links to py_find_1st.egg-info\dependency_links.txt
writing top-level names to py_find_1st.egg-info\top_level.txt
writing manifest file 'py_find_1st.egg-info\SOURCES.txt'
reading manifest file 'py_find_1st.egg-info\SOURCES.txt'
writing manifest file 'py_find_1st.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build
creating build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\utils_find_1st
copying utils_find_1st\__init__.py -> build\lib.win-amd64-3.5\utils_find_1st
running build_ext
Traceback (most recent call last):
File "setup.py", line 117, in <module>
zip_safe = False,
File "D:\Anaconda\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "D:\Anaconda\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "D:\Anaconda\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "D:\Anaconda\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\install.py", line 67, in run
File "D:\Anaconda\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\install.py", line 109, in do_egg_install
File "D:\Anaconda\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\Anaconda\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "D:\Anaconda\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\bdist_egg.py", line 161, in run
File "D:\Anaconda\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\bdist_egg.py", line 147, in call_command
File "D:\Anaconda\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\Anaconda\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "D:\Anaconda\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\install_lib.py", line 11, in run
File "D:\Anaconda\lib\distutils\command\install_lib.py", line 107, in build
self.run_command('build_ext')
File "D:\Anaconda\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\Anaconda\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "D:\Anaconda\lib\distutils\command\build_ext.py", line 338, in run
self.build_extensions()
File "setup.py", line 42, in build_extensions
if compiler_is_clang(self.compiler.compiler):
AttributeError: 'MSVCCompiler' object has no attribute 'compiler'
I am trying to install pyobjc-core which is a requirement for pyautogui. I am getting the below error while installing. I have already updated setuptools using
pip3 install --upgrade setuptools
and also using
sudo python3 ez_setup.py
I am on OSX Yosemite and using Python 3.5.
I see that the code below has a requirement for xcode. Could that be the reason and why would xcode be needed for this installation?
pip3 install pyobjc-core
Collecting pyobjc-core
Using cached pyobjc-core-3.1.1.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/pyobjc_core.egg-info
writing include/pyobjc-compat.h to pip-egg-info/pyobjc_core.egg-info/include/pyobjc-compat.h
writing include/pyobjc-api.h to pip-egg-info/pyobjc_core.egg-info/include/pyobjc-api.h
writing namespace_packages to pip-egg-info/pyobjc_core.egg-info/namespace_packages.txt
writing top-level names to pip-egg-info/pyobjc_core.egg-info/top_level.txt
writing dependency_links to pip-egg-info/pyobjc_core.egg-info/dependency_links.txt
writing pip-egg-info/pyobjc_core.egg-info/PKG-INFO
writing manifest file 'pip-egg-info/pyobjc_core.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/zw/573csqzn0pnbjkb44gw2s7800000gn/T/pip-build-72bxsxfe/pyobjc-core/setup.py", line 696, in
**parse_package_metadata()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/private/var/folders/zw/573csqzn0pnbjkb44gw2s7800000gn/T/pip-build-72bxsxfe/pyobjc-core/setup.py", line 371, in run
egg_info.egg_info.run(self)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools-23.0.0-py3.5.egg/setuptools/command/egg_info.py", line 193, in run
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools-23.0.0-py3.5.egg/setuptools/command/egg_info.py", line 216, in find_sources
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools-23.0.0-py3.5.egg/setuptools/command/egg_info.py", line 300, in run
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools-23.0.0-py3.5.egg/setuptools/command/egg_info.py", line 329, in add_defaults
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools-23.0.0-py3.5.egg/setuptools/command/sdist.py", line 132, in add_defaults
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/cmd.py", line 299, in get_finalized_command
cmd_obj.ensure_finalized()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "/private/var/folders/zw/573csqzn0pnbjkb44gw2s7800000gn/T/pip-build-72bxsxfe/pyobjc-core/setup.py", line 525, in finalize_options
universal_newlines=True).strip()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 629, in check_output
**kwargs).stdout
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 711, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/bin/xcodebuild', '-version', '-sdk', 'macosx', 'Path']' returned non-zero exit status 1
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/zw/573csqzn0pnbjkb44gw2s7800000gn/T/pip-build-72bxsxfe/pyobjc-core/
The error is clear: you need xcode...
It's silly but unfortunately there are these developer tools that are tied to it, and since many packages require dev tools (in your specific case xcodebuild needs it) you have to install xcode (anyway it's free)