rpy2 installation error on Windows 8 (Anaconda) - python

I have the latest Anaconda Python distribution installed on Windows 8 and I am attempting to install the rpy2 package. I initially ran into several issues that I was able to circumvent but I'm now stuck on one particular error that I'm pasting below.
The command
pip install rpy2
exits with the following error message:
In file included from .\rpy\rinterface\_rinterface.c:58:0:
.\rpy\rinterface\_rinterface.h:8:15: fatal error: R.h: No such file or
directory
compilation terminated.
error: command 'gcc' failed with exit status 1
Any suggestions? The path to R.h is included on my environment.

Dr. Gohlke's binary is probably the easiest solution. But you need to change the Python installation path in your registry for this method to work. The relevant key is in HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\InstallPath. Change it so that the anaconda Python is the default python installation. You can always change it back if you want.

Related

Pip install results in this error " cl.exe' failed with exit code 2 "

I've read all of the other questions on this error and frustratingly enough, none give a solution that works.
If I run pip install sentencepiece in the cmd line, it gives me the following output.
src/sentencepiece/sentencepiece_wrap.cxx(2809): fatal error C1083: Cannot open include file: 'sentencepiece_processor.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
I'm running python 3.10.1 and pip 22.0.3 .
*I have the following Microsoft Visual C++ programs on my windows machine,which I've just done a fresh install of as it was complaining of not having a particular C++ program.
MS VC++
I've even added the .exe file to my PATH variables but still I get the same error.
Am I missing a particular Microsoft program on my pc?
I haven't seen this problem in Windows, but for Linux, I would normally reinstall Python after installing the dependencies (such as the MSVC thing). In that case this is especially helpful because I'm often rebuilding (compiling and other related steps) Python/Pip.
Could also just be an error specific to the module and Python version combo you're trying.
From a discussion in the comments:
I have the pyenv-win version manager, so I was able to create venvs and test this for you. With Python 3.10.2, it fails; with Python 3.8.10, it's successful. So, yes, reinstalling does seem to be worthy of your time.
With python3.10
On Windows: First, install vcpkg and install sentencepiece:x64-windows-static
copy the header and lib files from vcpkg/installed/x64-windows-static/include and lib to
C:/Program Files/python310/build/root/include and lib
This should work as the setup.py install expects the library in a ..\build\root\lib directory.
As the C:\Program Files\python310\lib is in the /LIBPATH, the resulting ..\build\root\lib will point to the sentencepiece.lib
If still encounting errors, then set the INCLUDE and LIB environment variables so that the cl.exe , which is called from pip install sentencetransformers finds them.
People having windows+python 3.10 env, here are exact steps to install it via vcpkg.
Other instructions are covered in zweistein's answer.
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install sentencepiece:x64-windows-static

CMake error: C++ 11 not supported on Mac high sierra

I was trying to install opencv for python using this link. After running the Cmake command, it exited with errors stating C++11 is not supported Although I have Xcode installed. I Also tried forcing Cmake to use C++ 11 using $ set(CMAKE_CXX_STANDARD 11) (because my Cmake version is 3.10.2), but I got this error:
syntax error near unexpected token `CMAKE_CXX_STANDARD'
Moreover, I tried installing gcc to check if my system supports the C++ 11 compiler through this link, where again I ran into terminal errors stating ./fixincludes: No such file or directory after running $ make install . What should I do?
Adrian has a more recent blog post on compiling OpenCV for the macOS. The instructions work both for 3.3.0 and 3.3.1.
First open python by python2 or python3 command in terminal after type import cv2 and everything is right now.

Error during boost and dlib installation for Python 3.6

I am struggling to install dlib for Python 3.6 on Windows 10. I've installed and built boost, added ...\boost_1_63_0 folder along with ...\boost_1_63_0\stage\lib folder to the PATH.
But I still have the following message
LINK : fatal error LNK1104: cannot open file 'python36.lib' [C:\Users\admin\dlib\tools\python\build\dlib_.vcxproj]
19 Warning(s)
1 Error(s)
Time Elapsed 00:05:03.17
error: cmake build failed!
when I try to type python setup.py install in command prompt.
Also, I have LINK : fatal error LNK1104: cannot open file 'libboost_python-vc140-mt-s-1_63.lib' message, when I try to install dlib through pip install dlib.
Please, help me! Otherwise, I'm feeling desperate right now after all those hours of searching for a valid solution.
After all those wasted hours of search, I have finally fixed this problem. So I will just leave the way that worked for me, so people who will face the same problem in future could find it.
The reason for such an error was that dlib's latest version doesn't support Python 3.6, which I have never noticed anywhere except this page.
The solution for problem was to install Python 3.5 and to add C:\..\Python35\libs, C:\..\Python35\include, C:\..\Python35, C:\..\Python35\Scripts paths to Windows system PATH.

Error trying to install yowsup on windows

I followed instructions as given here
I installed python 3.4.3, then installed zlib and finally executed python setup.py install after downloading extracting the yowsup from hereenter link description here
and changed directory to yowsup-master.
But I get this error:
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: build\
temp.win-amd64-3.4\Release\curve25519module.o: bad reloc address 0x14 in section
`.data'
collect2.exe: error: ld returned 1 exit status
error: command 'C:\\MinGW\\bin\\gcc.exe' failed with exit status 1
Then since above did not work, I tried using pip install yowsup2 but I get the same error.
Could anyone get round this error?
I am not into python, so not able to tell why is this error happening.
I am on windows 8.1 64 bit.
There are few things which don't let you import that yowsup module in windows even in windows 10. so i have managed to install that in linux os (i am using kali linux) i have tryed to download and install the visual c++ build tool but that is just waste of time and data.
So Better switch to a Cloud like heroku or sitch to linux (vm or duel boot)

Pip install fuzzy fails because gcc fails to compile

I want to install fuzzy python package. I have windows 7 operating system with mingw32 and python 2.7. When I try to pip install the fuzzy package, I get the following error.
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: build\temp.win-amd64-2.7\Release\src\fuzzy.o: bad reloc address 0x0 in section `.data'
collect2.exe: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
Here's the complete log.
Please please help!
I had the same error when trying to install the (not part of anaconda) mmh3 module on an anaconda installation on windows.
It seems that your path includes an independent mingw installation (c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe)
I had to remove my mingw from my path so that it used the MiniGW that corresponds to your Python, so try to check e.g. if
ld.exe -version
and
...\anaconda\MinGW\bin\ld.exe -version
give you the same, if not, make sure your path is correct as discussed above...

Categories