I'm trying to get virtualenv to work on my machine. I'm using python2.6, and after installing pip, and using pip to install virtualenv, running "virtualenv --no-site-packages cyclesg" results in the following:
New python executable in cyclesg/bin/python
Installing setuptools....
Complete output from command /home/nubela/Workspace/cyclesg...ython -c "#!python
\"\"\"Bootstrap setuptoo...
" /usr/lib/python2.6/site-packag...6.egg:
error: invalid Python installation: unable to open /home/nubela/Workspace/cyclesg_dep/cyclesg/include/multiarch-i386-linux/python2.6/pyconfig.h (No such file or directory)
----------------------------------------
...Installing setuptools...done.
New python executable in cyclesg/bin/python
Installing setuptools....
Complete output from command /home/nubela/Workspace/cyclesg...ython -c "#!python
\"\"\"Bootstrap setuptoo...
" /usr/lib/python2.6/site-packag...6.egg:
error: invalid Python installation: unable to open /home/nubela/Workspace/cyclesg_dep/cyclesg/include/multiarch-i386-linux/python2.6/pyconfig.h (No such file or directory)
----------------------------------------
...Installing setuptools...done.
Any idea how I can remedy this? Thanks!
Are you on mandriva?
In order to support multilib (mixing x86/x86_64) Mandriva messes up your python installation. They patched python, which breaks virtualenv; instead of fixing python, they then proceeded to patch virtualenv. This is useless if you are using your own virtualenv installed from pip.
Here is the bug: https://qa.mandriva.com/show_bug.cgi?id=42808
Are you on a linux based system? It looks like virtualenv is trying to build a new python exectable but can't find the files to do that. Try installing the python-dev package.
Related
I'm trying to install python-rocksdb on a windows 10 machine and I'm coming across some issues with the install.
I have successfully installed rocksdb first using the vcpkg method.
When running pip install python-rocksdb I get the following error:
cl : Command line error D8021 : invalid numeric argument '/Wextra'
error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
Looking around suggested attempting to install with GCC or G++, so I downloaded cygwin and then attempted to install the python package using
pip install --global-option build_ext --global-option --compiler=cygwin python-rocksdb which yielded the following error:
gcc: error: unrecognized command-line option ‘-mcygwin’
error: command 'C:\\cygwin64\\bin\\gcc.exe' failed with exit code 1
This post seems to suggest that you need to use g++ specifically, but it looks like the cygwin command is defaulting to gcc.
Just note that I'm not using the virtual env with python.
Any assistance is greatly appreciated.
The Goal
Install ssdeep PyPi package on a M1 Macbook Pro.
The Problem
When I run pip install ssdeep I get 2 errors
The first error is caused because fuzzy.h cannot be found.
warnings.warn(
running egg_info
creating /private/var/folders/0f/4c82tsj50n10zqq89fndcslc0000gn/T/pip-pip-egg-info-ai0atrdv/ssdeep.egg-info
writing /private/var/folders/0f/4c82tsj50n10zqq89fndcslc0000gn/T/pip-pip-egg-info-ai0atrdv/ssdeep.egg-info/PKG-INFO
writing dependency_links to /private/var/folders/0f/4c82tsj50n10zqq89fndcslc0000gn/T/pip-pip-egg-info-ai0atrdv/ssdeep.egg-info/dependency_links.txt
writing requirements to /private/var/folders/0f/4c82tsj50n10zqq89fndcslc0000gn/T/pip-pip-egg-info-ai0atrdv/ssdeep.egg-info/requires.txt
writing top-level names to /private/var/folders/0f/4c82tsj50n10zqq89fndcslc0000gn/T/pip-pip-egg-info-ai0atrdv/ssdeep.egg-info/top_level.txt
writing manifest file '/private/var/folders/0f/4c82tsj50n10zqq89fndcslc0000gn/T/pip-pip-egg-info-ai0atrdv/ssdeep.egg-info/SOURCES.txt'
src/ssdeep/__pycache__/_ssdeep_cffi_a28e5628x27adcb8d.c:266:14: fatal error: 'fuzzy.h' file not found
#include "fuzzy.h"
^~~~~~~~~
1 error generated.
Traceback (most recent call last):
File "/Users/user/proj/.venv/lib/python3.11/site-packages/setuptools/_distutils/unixccompiler.py", line 186, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
File "/Users/user/proj/.venv/lib/python3.11/site-packages/setuptools/_distutils/ccompiler.py", line 1007, in spawn
spawn(cmd, dry_run=self.dry_run, **kwargs)
File "/Users/user/proj/.venv/lib/python3.11/site-packages/setuptools/_distutils/spawn.py", line 70, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/usr/bin/clang' failed with exit code 1
The second error has to do with setuptools.installer being deprecated. I'm not sure this is all that important though. I think resolving the first error would resolve this one as well.
/Users/user/proj/.venv/lib/python3.11/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
Attempted Solutions
Solution 1: Install SSDeep with Homebrew brew install ssdeep
Result: pip install ssdeep has the same error about fuzzy.h missing
Solution 2: Use the prepackaged version of SSDeep BUILD_LIB=1 pip install ssdeep
Result: The error about fuzzy.h goes away but the second error regarding setuptools.installer being deprecated remains.
References
Compiling SSDeep and pydeep on MacOS X 10.9+ This was pretty out of date though.
SSDeep Documentation
ssdeep package at PyPI is a Python wrapper for ssdeep library written in C. So first you have to compile and install ssdeep, then other python-ssdeep requirements, then compile and install python-ssdeep.
I found a solution. Essentially what's going on is that Homebrew installs ssdeep in a location that the ssdeep PyPi package is not expecting. You can point the PyPi package to the correct locations with the following steps.
1: Install ssdeep with homebrew brew install ssdeep
2: List homebrew directories for ssdeep brew ls ssdeep
This produces output like
/opt/homebrew/Cellar/ssdeep/2.14.1/bin/ssdeep
/opt/homebrew/Cellar/ssdeep/2.14.1/include/ (2 files)
/opt/homebrew/Cellar/ssdeep/2.14.1/lib/libfuzzy.2.dylib
/opt/homebrew/Cellar/ssdeep/2.14.1/lib/ (2 other files)
/opt/homebrew/Cellar/ssdeep/2.14.1/share/man/man1/ssdeep.1
3: Set the LDFLAGS environment variable to the path of the ssdeep lib directory from the output in step 2.
LDFLAGS="-L/opt/homebrew/Cellar/ssdeep/2.14.1/lib"
4: Set the C_INCLUDE_PATH environment variable to the path of the ssdeep include directory from the output in step 2.
export C_INCLUDE_PATH=/opt/homebrew/Cellar/ssdeep/2.14.1/include
5: Install ssdeep from PyPi pip install ssdeep
#HopAlongPolly answer almost worked for me but i got an error which the root cause seems to be:
ld: warning: ignoring file /opt/homebrew/Cellar/ssdeep/2.14.1/lib/libfuzzy.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
to solve this i ran BUILD_LIB=1 pip install ssdeep
If your env is pretty new you will get the following errors:
/bin/sh: libtoolize: command not found
/bin/sh: automake: command not found
to solve this you need to run brew install libtool automake and then create the following a symlink somewhere in your path from libtoolize to the glibtoolize binary that was installed via brew (This is needed as build process looks for libtoolize but homebrew installs glibtoolize). Pretty sure there is a cleaner way to point to the correct binary but the symlink did the job ;)
In summary do the steps that #HopAlongPolly recommended then run
brew install libtool automake
ln -s /opt/homebrew/bin/glibtoolize /opt/homebrew/bin/libtoolize
BUILD_LIB=1 pip install ssdeep
While trying to install cvxpy package using pip install on Mac, I get the following error message:
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from cvxpy/cvxcore/src/cvxcore.cpp:15:
cvxpy/cvxcore/src/cvxcore.hpp:18:10: fatal error: 'vector' file not found
#include <vector>
^~~~~~~~
1 warning and 1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
Mac is running OS Mojave.
I solved the issue using the following steps,
First I tried changing the flags to instruct the installation to use libc++,
CFLAGS=-stdlib=libc++ pip install cvxpy
Then it complained about having an invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later).
Then I ran the following command to set the deployment target,
export MACOSX_DEPLOYMENT_TARGET=10.10
Then running the first command(CFLAGS=-stdlib=libc++ pip install cvxpy) again installed cvxpy successfully.
I have been struggling with this all weekend and the most success I have found so far is installing cvxpy in an anaconda environment with these two lines:
conda install -c conda-forge lapack
conda install -c cvxgrp cvxpy
I had a similar error on Mojave. The problem is that the location of the headers installed by XCode command-line tools (which includes clang) have changed. I was able to get it working by adding this to my ~/.bash_profile and opening a new shell:
export CFLAGS="-I/usr/local/include -L/usr/local/lib -I$(brew --prefix openssl)/include -I$(xcrun --show-sdk-path)/usr/include"
This adds flags to CLANG that tell it to run the xcrun command to find the headers. It also adds the homebrew openssl headers to the clang path, which may not be necessary for this case (and assumes you have them installed).
See: https://stackoverflow.com/a/52871908/8344813
I am trying to install a Python package and I get a dependency error but I am sure I have fulfilled that requirement.
It says that it can't find libdickinson.so, but this library is already installed (system wide) and its files are in /user/local/lib/. What am I doing wrong?
This is my console output:
(iwidget)chris#mint-desktop ~ $ pip install pthelma
Downloading/unpacking pthelma
Downloading pthelma-0.7.2.tar.gz (50kB): 50kB downloaded
Running setup.py egg_info for package pthelma
libdickinson.so: cannot open shared object file: No such file or directory
Please make sure you have installed dickinson
(see http://dickinson.readthedocs.org/).
Complete output from command python setup.py egg_info:
libdickinson.so: cannot open shared object file: No such file or directory
Please make sure you have installed dickinson
(see http://dickinson.readthedocs.org/).
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /home/chris/.virtualenvs/iwidget/build/pthelma
Storing complete log in /home/chris/.pip/pip.log
(iwidget)chris#mint-desktop ~ $ ls /usr/local/lib/
libdickinson.a libdickinson.la libdickinson.so libdickinson.so.0 libdickinson.so.0.0.0 python2.7/ python3.2/ site_ruby/
(iwidget)chris#mint-desktop ~ $
Also try the above command as superuser:
sudo pip install pthelma
and just go through the thread given below:
Why can't Python find shared objects that are in directories in sys.path?
Try building it yourself and installing from the GIT repo:
git clone https://github.com/openmeteo/pthelma.git
Also, try running it as super user (pip).
sudo pip install pthelma
It looks like it can't see the libdickinson.so file but if you're confident it's installed and setup correctly you can, as I said, try cloning the source and building it that way.
I would like to install the ephem package in my Python 3.3.0 version under Windows XP.
I tried first the pip install ephem route from the system command prompt. The process aborted with the error message of Unable to find vcvarsall.bat.
I read prior advice on the net for such a difficulty. Following it I installed mingw32 in my computer, added C:\MinGW\bin to the PATH variable and provided Lib / distutils with a new file called distutils.cfg and the content:
[build]
compiler=mingw32
On running now any of the install commands (pip, *easy_install* and setup.py all work the same) the following error results:
C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -Ilibastro-3.7.5 -IC:\Python33\
include -IC:\Python33\include -c extensions/_libastro.c -o build\temp.win32-3.3\
Release\extensions\_libastro.o
cc1.exe: error: unrecognised command line option '-mno-cygwin'
error: command 'gcc' failed with exit status 1
I have tried to understand and solve the problem, but have been unsuccesful. I have not been able even to find the place in the code where such values are established.
¿Could somebody provide any help? ¿Would ephem be one of the cases alluded by Installing Python modules in the 3.3.0 Documentation with "Not all extensions can be built with MinGW or Cygwin, but many can."?
Thanks in advance
Paco
Here is an extremely useful page of Windows binaries of python packages: http://www.lfd.uci.edu/~gohlke/pythonlibs/.
It includes binaries for pyephem.