I am trying to install a python package dimod. the command line to install is python setup.py install....it ran out the below error:
/usr/local/boost-1.74.0/include/boost/type_traits/add_pointer.hpp:12:10: fatal error:
'boost/type_traits/remove_reference.hpp' file not found
#include <boost/type_traits/remove_reference.hpp>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I installed boost library in the path /usr/local/boost-1.74.0/...But it seems all my boost library files path is boost/......I am manually changing the include path....but it is too much work.
Could anyone give a hint what I should do? It seems a very trivial Library linking problem, isn't it?
Thanks.
Related
I am trying to install couchapp from the terminal on macOs High Sierra.
I have python 2.7.10 installed (by default) and I run $ pip2 install couchapp according to the couchapp documentation.
This is the error I get:
src/watchdog_fsevents.c:22:10: fatal error: 'Python/Python.h' file not found
#include <Python/Python.h>
^~~~~~~~~~~~~~~~~
1 error generated.
error: command 'cc' failed with exit status 1
----------------------------------------
Failed building wheel for watchdog
Here is what I have when I do $ ls in /System/Library/Frameworks/Python.framework/
Examples
Modules
Python
Resources
Versions
module.map
What I have tried so far:
Check that Xcode CL Tools are already installed running $ xcode-select --install
Try to use pip3 instead of pip2 (I have installed python 3.6 with Homebrew), but I get the same error message.
Do you have any idea? I have read other posts but they did not solve my problem.
Thank you
Had a very similar problem on my High Sierra (10.13.5) setup with Xcode CLI tools installed; for me the Python.h was found in /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
(Some resources say the location can be found via find /usr/local/Cellar/ -name Python.h, however this seems not work if your python was not installed with brew.)
Add the location to your C include path, or at compile time as a flag by setting -I flag as such: -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7.
The part that tripped me up was the import statement should then look like: #include <Python.h> rather than #include <Python/Python.h> if your Python.h is directly in the python2.7 directory.
Hope that helps,
Morning
To start out, let me just say I'm a python novice - so I hope this question isn't going to be stupid.
I'm running Mac 10.13.4 (Beta) and am trying to get PyMuPDF working.
As per https://github.com/rk700/PyMuPDF/:
I've downloaded both PyMuPDf and MuPDF.
I ran brew install mupdf-tools
I ran export ARCHFLAGS='-arch x86_64'
At this point I am not sure whether I need to build MuPDF by running
make prefix=/usr/local install
(as per https://mupdf.com/docs/building.html) or go straight to
python setup.py install
If I try build mupdf using make, then I get the following error:
include/mupdf/fitz/config.h:92:1: error: expected identifier or '('
... ... ...
^
In file included from source/fitz/archive.c:1:
In file included from include/mupdf/fitz.h:35:
include/mupdf/fitz/pixmap.h:360:2: error: unknown type name 'ptrdiff_t'
ptrdiff_t stride;
If I run the setup.py install, then I get errors when trying to import Fitz. I know that there is an instruction saying that the include_dirs and library_dirs should be updated, but the directories they refer to do not appear to be there (other that in the source files I downloaded).
I appreciate that this is all down to me being a python rookie - any pointers would be greatly appreciated.
Initial Question
I've installed scipopsuite by following these instructions: http://scip.zib.de/doc/html/MAKE.php#BRIEFINSTALL
Make tests - complete without error.
Then when I try pip install pyscipopt I get the following error.
src/pyscipopt/scip.c:467:10: fatal error: 'scip/scip.h' file not found
#include "scip/scip.h"
^
1 error generated.
error: command 'gcc' failed with exit status 1
Specs: Anaconda Python 2.7, latest OSX
Follow Up
In response to comments(#mattmilten), I've done the following.
(1) Installed the make file - When i tried to run the install it failed because the name of the O.darwin.x86_64.gnu.shared.opt folder was set to 'static' instead of shared. I changed that name and then the install completed but did have these warnings:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: lib/libscipopt-4.0.0.darwin.x86_64.gnu.opt.a(stkchk.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: lib/libscipopt-4.0.0.darwin.x86_64.gnu.opt.a(stkchk.o) has no symbols
When i try:
>>> import pyscipopt
, I now get the following error.
Any suggestions would be appreciated.
ImportError: dlopen(/Users/"local"/anaconda/lib/python2.7/site-packages/pyscipopt/scip.so, 2): Symbol not found: ___gmp_version
Referenced from: /Users/"local"/anaconda/lib/python2.7/site-packages/pyscipopt/scip.so
Expected in: flat namespace in /Users/"local"/anaconda/lib/python2.7/site-packages/pyscipopt/scip.so
I'm guessing these things are linked - thanks.
As explained in the PySCIPOpt INSTALL you need to tell Python where you installed the SCIP Opt Suite: export SCIPOPTDIR=<path_to_install_dir>
The setup.py looks for this environment variable so you need to set it before you run pip install pyscipopt
Edit:
You need to install the SCIP Opt Suite (this basically copies the compiled files to some directory) as also explained in the INSTALL file
Trying to install this Python IRC bot called Willie. This is what happens when I run setup.py:
C:\Python34\python.exe "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.5.1\helpers\pycharm\pycharm_setup_runner.py" C:\Users\Quibbles\Documents\willie-5.3.0\setup.py
Testing started at 1:35 PM ...
running pycharm_test
Searching for pygeoip
Best match: pygeoip 0.3.2
Processing pygeoip-0.3.2-py3.4.egg
Using c:\users\quibbles\documents\willie-5.3.0\.eggs\pygeoip-0.3.2-py3.4.egg
Searching for pyenchant
Best match: pyenchant 1.6.6
Processing pyenchant-1.6.6-py3.4-win32.egg
Using c:\users\quibbles\documents\willie-5.3.0\.eggs\pyenchant-1.6.6-py3.4-win32.egg
Searching for praw
Best match: praw 2.1.21
Processing praw-2.1.21-py3.4.egg
Using c:\users\quibbles\documents\willie-5.3.0\.eggs\praw-2.1.21-py3.4.egg
Searching for lxml
Reading https://pypi.python.org/simple/lxml/
Best match: lxml 3.4.4
Downloading https://pypi.python.org/packages/source/l/lxml/lxml-3.4.4.tar.gz#md5=a9a65972afc173ec7a39c585f4eea69c
Processing lxml-3.4.4.tar.gz
Writing C:\Users\Quibbles\AppData\Local\Temp\easy_install-p_x9naya\lxml-3.4.4\setup.cfg
Running lxml-3.4.4\setup.py -q bdist_egg --dist-dir C:\Users\Quibbles\AppData\Local\Temp\easy_install-p_x9naya\lxml-3.4.4\egg-dist-tmp-0expfysa
Building lxml version 3.4.4.
Building without Cython.
ERROR: b"'xslt-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
C:\Python34\lib\distutils\dist.py:260: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
cl : Command line warning D9025 : overriding '/W3' with '/w'
lxml.etree.c
C:\Users\Quibbles\AppData\Local\Temp\easy_install-p_x9naya\lxml-3.4.4\src\lxml\includes\etree_defs.h(14) : fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory
error: Setup script exited with error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2
Process finished with exit code 1
What am I doing wrong? I downloaded the source code from https://github.com/embolalia/willie/releases/tag/v5.3.0 and tried running setup.py in PyCharm.
It should be fairly obvious by the error messages:
** make sure the development packages of libxml2 and libxslt are installed **
You need to have the dev libxml2 and libxslt installed. It appears either you have the wrong versions perhaps, or don't have them installed properly.
I'L'I's answer gives you a hint of where to start searching next, but isn't a useful answer.
After several attempts on my own, I found that to get the lxml library installed, I needed to do the following:
First, download the lxml library from http://www.lfd.uci.edu/~gohlke/pythonlibs/
This is necessary because the PiPy archives (https://pypi.python.org/pypi/lxml/3.4.4) are way out of date, only giving you the option to install for Python 3.2 for the 3+ series, which of course is useless if you're on 3.4. There's also issues if you're using 64-bit. They may be sufficient if you're using 2.7, though.
Then use the instructions here: How do I install a Python package with a .whl file? to install the .whl file.
However that only fixes half the problem. The willie package appears to be broken in other ways (on Windows) because of trying to reference a unix-like /tmp directory (absolute path) instead of the proper Windows Temp directory.
This issue describes the problem, though no fix has yet been made: https://github.com/embolalia/willie/issues/811
It indicates that it's a Windows-specific bug in the installer. To work around that, download the .tar.gz from https://pypi.python.org/pypi/willie/5.3.0
Unpack it. Go to the willie-5.3.0\willie.egg-info directory, and edit the SOURCES.txt file. The fifth line is /tmp/tmpeAhjCF/willie. Delete that line.
Repackage the directory into a .tar.gz archive. Install via pip install .\willie-5.3.0.tar.gz.
Now it's installed, and you're ready for the next round of problems of actually getting it to run on Windows. Since I haven't actually succeeded in doing that yet, that's as far as I can help for right now.
I have Python 2.7 and I was trying to use PyQuery, so for a test I just typed "import PyQuery" and I got an error:
Traceback (most recent call last):
File "C:\Users\Jacob\Documents\dupes.py", line 1, in <module>
import pyquery
File "C:\Python27\lib\site-packages\pyquery-1.2.1-py2.7.egg\pyquery\__init__.py", line 12, in <module>
from .pyquery import PyQuery
File "C:\Python27\lib\site-packages\pyquery-1.2.1-py2.7.egg\pyquery\pyquery.py", line 8, in <module>
from lxml import etree
ImportError: No module named lxml
So I went to the command prompt and tried to install lxml, but I got this:
Building lxml version 2.3.5.
Building without Cython.
ERROR: 'xslt-config' is not recognized as an internal or external command,
operable program or batch file.
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
error: Setup script exited with error: Unable to find vcvarsall.bat
I don't really understand what's wrong or what I should do...can someone help?
Thanks.
EDIT:
In response to the comment, I used easy install...
From installation instructions of lxml:
easy_install --allow-hosts=lxml.de,*.python.org lxml
On MS Windows, the above will install the binary builds that we provide. If there is no binary build of the latest release yet, please search PyPI for the last release that has them and pass that version to easy_install like this:
easy_install --allow-hosts=lxml.de,*.python.org lxml==2.2.2
[edit]
Ok, 2.2.2 was en example. I went and looked for you, try:
easy_install --allow-hosts=lxml.de,*.python.org lxml==2.3
Unless your Windows environment is properly set (proper Visual Studio version for your Python version and all that), you should download binary eggs and install them. I know setuptools (and possibly distribute) support installing binary executable packages on Windows (the distutils-based executables only - the ones with the blue background and old dot-matrix Python logo; sorry, but I haven't done Python on Windows in a couple months). Pip doesn't (probably what you are/were using).
But to answer your question, the batch file vcvarsall.bat is used to set the environment variables necessary for building Visual Studio projects/solutions (and generally using any Visual Studio tools) from the command line. It's not in your PATH by default, and since pip is trying to use it to build lxml properly, it fails.
My advice: unless you know how to use Visual Studio command line tools, you're much better off using binary packages on Windows.