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.
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.
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 have only recently started to learn programming with python. Currently I am trying to install pygame but I am constantly gettting the same error:
C:\WINDOWS\system32>python -m pip install pygame
Collecting pygame
Using cached pygame-1.9.2.tar.gz
Complete output from command python setup.py egg_info:
WARNING, No "Setup" File Exists, Running "config.py"
Using WINDOWS configuration...
Path for SDL not found.
Too bad that is a requirement! Hand-fix the "Setup"
Path for FONT not found.
Path for IMAGE not found.
Path for MIXER not found.
Path for PNG not found.
Path for JPEG not found.
Path for PORTMIDI not found.
Path for COPYLIB_tiff not found.
Path for COPYLIB_z not found.
Path for COPYLIB_vorbis not found.
Path for COPYLIB_ogg not found.
If you get compiler errors during install, doublecheck
the compiler flags in the "Setup" file.
Continuing With "setup.py"
Error with the "Setup" file,
perhaps make a clean copy from "Setup.in".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\filip\appdata\local\temp\pip-build-0xsf1b\pygame\setup.py", line 165, in <module>
extensions = read_setup_file('Setup')
File "C:\Python33\lib\distutils\extension.py", line 164, in read_setup_file
line = expand_makefile_vars(line, vars)
File "C:\Python33\lib\distutils\sysconfig.py", line 430, in expand_makefile_vars
s = s[0:beg] + vars.get(m.group(1)) + s[end:]
TypeError: Can't convert 'NoneType' object to str implicitly
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\filip\appdata\local\temp\pip-build-0xsf1b\pygame\
I already went through a number of posts with similar problems but none of them had the exactly same issue, and/or they were concerned with different packages and operating systems. Moreover, I tried a couple of solutions to those problems but nothing worked for me (i tried upgrading pip, installing with easy_install and some other options I, unfortunately, cannot even recall at this point...).
I would be sincerely grateful if someone can help me with this problem. I am aware that it is possibly an irrelevant or "newbie" question, but I honestly tried finding a solution on my own and really have no more clue what to do. I have also never been really educated in computer science, so all of these things frustrate and confuse the hell out of me and constantly get in the way of the learning process (which is hard enough).
I am using Windows 10, python 3.3 64-bit.
Thank you!
Another way to install pygame, which worked for me (W10 64bit, Python 3.4.5).
Head here and download the correct pygame wheel file for your version. Then, from cmd, go to the directory the file is in, and type pip install [COMPLETE EXACT FILENAME].
Good luck!
I had the same problem but i solved it by updating pip
Try install pygame from this repository: http://www.lfd.uci.edu/~gohlke/pythonlibs/
It is not a official place, but it is trusted. I was having this same problem, and I resolved it installing the package (pygame) from this website. You just have to download the intended".whl" file and install with "pip" from the place where your download is placed.
Don't forget uninstall the previous Pygame installed. =)
Try upgrading pip. Simply open your command line (search cmd in your task bar search box) and enter the command below:
pip install --upgrade pip
Just downgrade your Python version. Uninstall your current Python and delete uninstalled python folder, then install python3.5.
Last, you can use the command line:
pip3 install pygame
It worked for me.
Check your mysql configuration file using this:
mysql_config
Now you should get an output something like this:
mysql_config
Usage: /usr/bin/mysql_config [OPTIONS]
Compiler: GNU 6.3.0
Options:
--cflags [-I/usr/include/mysql ]
--cxxflags [-I/usr/include/mysql ]
--include [-I/usr/include/mysql]
--libs [-L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -lm -lrt -latomic -ldl]
--libs_r [-L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -lm -lrt -latomic -ldl]
--plugindir [/usr/lib/mysql/plugin]
--socket [/var/run/mysqld/mysqld.sock]
--port [0]
--version [5.7.18]
--libmysqld-libs [-L/usr/lib/x86_64-linux-gnu -lmysqld -lpthread -lz -lm -lrt -latomic -lcrypt -ldl -laio -llz4 -lnuma]
--variable=VAR VAR is one of:
pkgincludedir [/usr/include/mysql]
pkglibdir [/usr/lib/x86_64-linux-gnu]
plugindir [/usr/lib/mysql/plugin]
Ideally it should contain libmysqld-libs option. If it is not there, as it was not there in my case, you can assume that your mysql is broken.
In this case you can write this configuration to config file directly
I seem to be one of the many people struggling to install gensim on windows. I have trawled through countless forums but the errors poster there never appear to match my errors. So hopefully someone can point me in the right direction!
I am running Windows Server 2012 R2 Standard 64-bit. I have installed MinGW & Anaconda 2.2.0 (64-bit), which comes with Python 2.7.9.
I have added a file distutils.cfg into C:\Users\Sam\Anaconda\Lib\distutils with the contents:
[build]
compiler=mingw32
I have added C:\MinGW\bin to my Environment variables.
If I install gensim using pip I do not get any errors, until I try to run Word2Vec when I get the error:
C:\Users\sam.passmore\AppData\Local\Continuum\Anaconda\lib\site-packages\gensim\models\word2vec.py:459: UserWarning: C extension com
pilation failed, training will be slow. Install a C compiler and reinstall gensim for fast training.
So I have uninstalled gensim and tried to re-install using the mingw32 compiler, but this gives me this error:
python setup.py build --compiler=mingw32
c:\users\sam.passmore\appdata\local\continuum\anaconda\lib\site-packages\setuptools-14.3-py2.7.egg\setuptools\dist.py:282: UserWarni
ng: Normalizing '0.11.1-1' to '0.11.1.post1'
running build
running build_ext
building 'gensim.models.word2vec_inner' extension
C:\MinGW\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall -Igensim\models -IC:\Users\sam.passmore\AppData\Local\Continuum\Anaconda\include -IC:
\Users\sam.passmore\AppData\Local\Continuum\Anaconda\PC -IC:\Users\sam.passmore\AppData\Local\Continuum\Anaconda\lib\site-packages\n
umpy\core\include -c ./gensim/models/word2vec_inner.c -o build\temp.win-amd64-2.7\Release\.\gensim\models\word2vec_inner.o
gcc: error: ./gensim/models/word2vec_inner.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
command 'C:\\MinGW\\bin\\gcc.exe' failed with exit status 1
setup.py:82: UserWarning:
********************************************************************
WARNING: %s could not
be compiled. No C extensions are essential for gensim to run,
although they do result in significant speed improvements for some modules.
%s
Here are some hints for popular operating systems:
If you are seeing this message on Linux you probably need to
install GCC and/or the Python development package for your
version of Python.
Debian and Ubuntu users should issue the following command:
$ sudo apt-get install build-essential python-dev
RedHat, CentOS, and Fedora users should issue the following command:
$ sudo yum install gcc python-devel
If you are seeing this message on OSX please read the documentation
here:
http://api.mongodb.org/python/current/installation.html#osx
********************************************************************
The gensim.models.word2vec_inner extension moduleThe output above this warning shows how the compilation failed.
"The output above this warning shows how the compilation failed.")
building 'gensim.models.doc2vec_inner' extension
C:\MinGW\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall -Igensim\models -IC:\Users\sam.passmore\AppData\Local\Continuum\Anaconda\include -IC:
\Users\sam.passmore\AppData\Local\Continuum\Anaconda\PC -IC:\Users\sam.passmore\AppData\Local\Continuum\Anaconda\lib\site-packages\n
umpy\core\include -c ./gensim/models/doc2vec_inner.c -o build\temp.win-amd64-2.7\Release\.\gensim\models\doc2vec_inner.o
gcc: error: ./gensim/models/doc2vec_inner.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
command 'C:\\MinGW\\bin\\gcc.exe' failed with exit status 1
setup.py:82: UserWarning:
********************************************************************
WARNING: %s could not
be compiled. No C extensions are essential for gensim to run,
although they do result in significant speed improvements for some modules.
%s
Here are some hints for popular operating systems:
If you are seeing this message on Linux you probably need to
install GCC and/or the Python development package for your
version of Python.
Debian and Ubuntu users should issue the following command:
$ sudo apt-get install build-essential python-dev
RedHat, CentOS, and Fedora users should issue the following command:
$ sudo yum install gcc python-devel
If you are seeing this message on OSX please read the documentation
here:
http://api.mongodb.org/python/current/installation.html#osx
********************************************************************
The gensim.models.doc2vec_inner extension moduleThe output above this warning shows how the compilation failed.
"The output above this warning shows how the compilation failed."
I have exhausted all options I can think of or find, so if anyone could give some advice it would be much appreciated.
I managed to solve this after using conda install for gensim, rather than pip.
conda install gensim
I am not sure what other steps I have included above have contributed to the answer, but this was the last thing I did before I no longer was getting the 'Install a C compiler and reinstall gensim for fast training.' message.
During my research in trying to solve this problem I saw that the most common methods were adding the lines
[build]
compiler=mingw32
to the distutils.cfg file as well as ensuring MinGW is in your path. Also ensuring that the MinGW bit version is the same as your python version.
I'd like to start by saying that asking a question here isn't something I do lightly. I've now been attempting to install Pygame 1.9.1 from source for four hours, and I've run into several problems but was able to overcome each one. This is the first one I'm completely stumped on.
After I unpack pygame-1.9.1release.tar.gz and cd to the folder, I run 'python3 setup.py install'
/Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL_syswm.h:58:10: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
After some online research, I read that X11 is no longer included with OSX 10.9, so I installed XQuartz in the hope that it could serve as a replacement.
Xquartz does include 'Xlib.h', but it's filepath is /opt/X11/include/X11/Xlib.h, and the setup script doesn't find it here. I've tried several ways to fix this.
The error process specifically comes up in the build part of the install. I've tried using
python3 setup.py config --include-dirs /opt/X11/include
as well as
python3 setup.py config --include-dirs /opt/X11/include/X11
but get the same error.
I read online that installing the Xcode command line tools could fix this problem. I'm ~95% sure I had the command line tools before, but I tried to get them again anyway with 'xcode-select --install' only to be told that 'Can't install the software because it is currently unavailable from the Software Update server'. "No problem," I tell myself and just download the package from the Mac developers site. It doesn't help anything.
I've also tried symlinking with the command
sudo ln -s /usr/include/X11 /opt/X11/include/X11
Of everything I've tried, I understand this the least, do I could very well be doing the symlink command wrong.
Two other commands I tried are
export C_INCLUDE_PATH=/opt/X11/include
export CPLUS_INCLUDE_PATH=/opt/X11/include
Just looking at the documentation, I came across a debug option for the startup script.
The output of 'python3 setup.py build -g' is
running build
running build_py
running build_ext
building 'pygame.display' extension
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -g -Ddarwin -I/Library/Frameworks/SDL.framework/Versions/Current/Headers -I/Library/Frameworks/Python.framework/Versions/3.3/include/python3.3m -c src/display.c -o build/temp.macosx-10.6-intel-3.3/src/display.o
In file included from src/display.c:30:
/Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL_syswm.h:58:10: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
^
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
I'm not sure what else I can do, but I'd really appreciate some help with this. Thanks in advance!
setup.py build|install commands accepts CFLAGS and LDFLAGS compiler options, as far as I know.
Thus here, you can do
CFLAGS=-I/opt/X11/include python3 setup.py install
You probably need the LDFLAGS as well; I'm not sure about the exact location, but something like
CFLAGS=-I/opt/X11/include LDFLAGS=-L/opt/X11/lib python3 setup.py install
seems logical.
After that, you may have to set your DYLD_LIBRARY_PATH to point to your X11 libraries. In case your installation proceeds but your PyGame script won't run and complains about not finding X11 libraries. Thus
export DYLD_LIBRARY_PATH=/opt/X11/lib
As for the symbolic link you tried to create: it's the wrong way 'round: the two paths should have been switched, so I guess you got an error because /opt/X11/include/X11 already exists. But with the above, no symlink is necessary.
I ran into a similar error when trying to install pygame into my PyCharm project's virtualenv. I solved it by cding to the SDL Framework directory where the error originated and copying the X11 header files into it:
$ cd /Library/Frameworks/SDL.framework/Versions/Current/Headers
$ cp -R /opt/X11/include/X11 ./
then $ pip install pygame ran without errors.