What setup is need to compile rpy2 on Windows? - python

I've been able to install rpy2 v2.0.8 from the .msi from source forge, but I'd like to use the latest version that includes the packages code, i.e. v2.1.9.
I'm attempting to compile rpy2 in windows (python 2.6.6).
CL is complaining because LibExtern is being defined as extern and as declspec in different place.
gcc and c++ can't compile without errors either.
I'm assuming this compiles ok on unix and that all I'm missing is some config (prob environment variables), since I can't believe it would have been released in a non-compilable form.
Any anyone point me in the right direction pls?
Many thx
DM

Your best bet is to download it from this site. It has all the popular repositories that need to be compiled in order to work. Its basically a group Unofficial Windows Binaries for Python Extension Packages by Christoph Gohlke at The Laboratory for Fluorescence Dynamics, University of California, Irvine.
I've given you the link to the latest version of rpy2, and there are versions for every type of Python. Please note that you will need R installed. Download the version for 2.7, it should work for 2.6.6, but if it does not, then update your Python 2.7.5.
However, if you are still keen on actually compiling the binaries, then you will need to give me the error messages and the tracebacks, as otherwise, one cannot know for sure what your exact problems are.

Related

Mac OS M1 Monterey 12.4: wrong python library with "Port"

I´ve got a new MacBook Pro with M1 chip and it seems as if not alle of the open source software is converted to arm64.
Nethertheless, I try to compile missing tools (like numpy) manuell from source, like in the good ole days. As I try to do it I have to install, deinstall a lot and one tool is "port" which is working except for one thing that it complains all the time about Libraries I don't use anymore (because some tools (like Eclipse) for example are not working with Python 3.10). Therefore I regressed to Python 3.9 but every time I want to install something with "port" (which it does), it complains about the "old" Python 3.10 libs. How could I get rid of this messages?
Warning: Error parsing file
/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/lxml/html/diff.cpython-310-darwin.so: Error opening or reading file
I was in a sort of "Dead-Lock" because versions, Libraries and executables were not consistent with Python, Eclipse, Python pip packages etc, because some packages weren't ported to amd64 until now. For example numpy and I tried to compile it from source which was possible but still not working.
Then I stumbled over a hint in a different problematic were Rosetta was recommended for that specific problem. (I´ve never worked with Rosetta because most applications were running)
So I duplicated the "terminal" Application and configured one for Rosetta, started and installed Python 3.10 in it with all new packages and startet all executables from that terminal.
After some fiddling Eclipse startet with Python and the packages which my application needed, like numpy.
(And in addition to that, it seems as if it very much faster than before)

Numpy Installation: How do I fix the broken toolchain without Bash and limited permissions?

Preface: I am a Mac/Unix user and am now a little lost with Windows.
Situation: I am trying to use python on a school machine that has a 64-bit architecture and running Windows 7. I have gotten the module NetworkX to work via python setup.py install, but need the numerical libraries to be available as well.
Question: I have the identical output as this question elaborates and need to install numpy with correct dependencies. How do I do this with limited permissions?
Problems: The solution in the above link cannot be adopted in my case. I do not have Visual Studio 2008 and cannot install it due to permissions. Also, the linear algebra library that is required costs 500$, which frankly is a deal breaker. I thought I could adopt this SO solution, but I do not have access to Bash. I also cannot run .exe files due to permissions. All the modules I have installed have been using python setup.py install. Any help or suggestions are VERY much appreciated.
Could you install one of the scientific python distributions like Anaconda or Canopy? That might include everything you need. See http://scipy.org/install.html for a list of options.

pyHook for Python 3.3

I am coding a simple keylogger using Python. I hope to use pyHook to capture keyboard events.I couldn't find any packages of pyHook for python 3.3 which I have installed. Is there any other module for python 3.3 which provides similar functionalities?
A quick google turned up this site, which has unofficial installers for pyHook 1.5.1 (and a whole lot of other packages) for Python 3.3. I haven't tested it, but it seems worth trying. And there are a couple of other similar repositories on the first page of Google results if this one doesn't work.
I also found a few forks on github, like this one, which have fixes for Unicode bugs in 3.x. I have no idea if those bugs have been fixed in the main pyHook project (or made it into the 1.5.1 release), but if you run into problems, you may want to take a look.
You'd have a lot more options if you installed a compiler (MinGW and/or Visual Studio Express) and used easy_install or pip to install packages automatically, building them from source if necessary. Then you wouldn't need to search for binary installers for everything.
The inofficial installers mentioned by abarnert seem to work fine. They provide installers for almost every version of Python - except for 3.5, which is currently considered unstable anyway (07/10/14), so that's not a big issue.

VTK / Python / compile

I want to use VTK together with Python on a Windows system.
It seems that I cannot use the windows installer but "have to compile VTK from source code using CMake and a native build system". So far I have installed CMake.
But now I wonder how to proceed? It seems that I need MS Visual Studio to create the project files?!
But I don't have Visual Studio. So what can I do?
There is a VTK installer here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
It appears to work fine for me and it beats compiling it.
It wasn't the case when you asked this question, but since version 6.1, vtk-python ships with a Windows (linux and osx) installer. See their download page for more information.
You can use VTK with python just installing pythonxy framework, it is just a python with many many libraries included VTK, ITK, Qt and many other, also it is very well documented, and also have many examples, all in python. I recommend it to you, I have worked a lot with it, and is very amazing.
Just make a try. All you have to do is in the installer wizard select among the tools, VTK, and it will be installed with vtk.
If 32bit is enough for you, I suggest looking into Python(x,y). You get not only VTK but a whole lot of other useful scientific libraries.

Multiple Versions of Python on my Windows machine: Which is the "right" one?

In continuing to research a solution for this question on ServerFault:
https://serverfault.com/questions/221203/mercurial-hook-fails-on-windows
I discovered an interesting and somewhat disturbing thing: I have seem three different versions of Python on my machine (four if you count the "official" version which doesn't appear to have a DLL with it....). Here's shot from my file search tool:
More Info:
I am running Windows 7 64-bit
Both the TortoiseHG and the Mercurial directories are on my path, with the Mercurial directory listed first.
I have Python 2.6 installed in c:\Python26
I have no entry for any type of PYTHON-based environmental variable. (Should I?)
I suspect that this is the source of the my problem from the question above, but I thought I'd ask here, as this is particular issue is a Python deal.
I tried to replace both DLLs with each other, but when I use the one that comes with Mercurial, then TortoiseHg stops working.
It seems to me that "there should only be one" Python on my machine. How do I achieve that?
For the problem that you mentioned earlier, the mercurial package got installed within python under mercurial home but you are executing scripts under C:\python26. So you need to install and execute your script under mercurial python
As seth mentioned earlier it is perfectly ok to multiple python homes in the same machine but you just to pay attention when installing python libraries to make sure that you are under the right home which means you set the path right before calling python.
Side note: The Python installation in "C:\Python26" installs its DLL to the Windows directory, in your case "C:\Windows\SysWOW64".
Answering your serverfault question: As you installed Mercurial as standalone version, you'll have to place any packages that are accessed by hooks into Mercurial's library folder (if it has one, could also be "library.zip").
I would recommend you to uninstall the Mercurial standalone version and instead install Mercurial with pip. This makes updates easier and you can use your normal "site-packages" directory for both normal Python libraries and hg hooks.
I would assume that tortoise/mercurial have just embedded their own versions of python to do whatever they need to do.
I wouldn't worry about it, the DLLs won't stomp on each other -- the PATH is the last placed that windows searches to find DLLs.
See: http://msdn.microsoft.com/en-us/library/7d83bc18(v=vs.80).aspx
Each DLL is for that application. There is only one in your search path so you don't need to worry about conflicts.
Is something not working that prompted you to worry about this??
Your assumption that there should only be one is wrong, each application has bundled a specific version with a fixed API, you can't just drop another in and hope it'll work.
The Python DLL naming structure only provides the major version and revision numbers. You are probably looking at the DLLs for versions 2.6.1, 2.6.4, 2.6.5, and 2.6.6.
All of this doesn't really matter as long as each application contains its own copy of the python26.dll. Windows will not explore the PATH environment variable if there is a local copy of the file.

Categories

Resources