Discussion:
[Python.NET] PythonDotNet Digest, Vol 122, Issue 17
Beckett Simmons
2014-06-18 19:38:24 UTC
Permalink
Hey Tony,
Following your advice I did a simple git reset and git clean to get back to the original source. Built pythonnet again.
Now a weird thing is happening. I can import clr in the Mircrosoft Windows 7 x64 Debug Build Environment prompt but only immediately after the build.
So I figure out that it was because I was in the pythonnet folder and that allows it to find the Python.Runtime.dll file at pythonnet\build\lib.win-amd64-3.4. I tried to to add multiple variations of that path to my system environment path. This did not work for me with any variation.
What I had to do to get clr to import was to move that Python.Runtime.dll file into the H:\py341Test\Lib\site-packages\pythonnet-2.0dev-py3.4-win-amd64.egg python virtual environment.
This works for me, or at least works enough to get my unit tests working. Although it doesn't seem to be the most elegant solution. Then again, I am using a third-party fork. Just wondering if you have any further pro tips about this.
Again, thank you very much for your help!
Beckett
Date: Wed, 18 Jun 2014 19:30:30 +0100
To: "A list for users and developers of Python for .NET"
Subject: Re: [Python.NET] Python 3.4 Support
Content-Type: text/plain; charset="utf-8"
Hi Becket,
hmmm, did you build it for 3.3 previously? The setupwin.py in this repo
doesn't clean before building and re-uses the same target for the different
python versions so it won't rebuild everything correctly when switching
between python versions. Try deleting all the build folders and re-build.
It's a bit rough and ready; the setup.py in the official repo works better.
If that doesn't work let me know as I had it working ok (but I'm still
using 3.2 mostly so it hasn't had much testing).
cheers,
Tony
Hey Tony,
Thanks for the help. I was able to build pythonnet with your instructions.
The issue that I am having now is that pythonnet seems to be build for
python33.
When I try to import clr I get this error and python.exe crashes.
http://pastebin.com/0zcW6nP0
How would I possibly point pythonnet to the correct python34 DLL?
http://pastebin.com/Gb4K5PZS
I would be worth while to note that I am building and running python on a
virtual environment that comes from a python 3.4.1 64-bit base install.
Would this possibly be the problem?
Beckett
Date: Tue, 17 Jun 2014 22:58:21 +0100
To: "A list for users and developers of Python for .NET"
Subject: Re: [Python.NET] PythonDotNet Digest, Vol 122, Issue 13
Content-Type: text/plain; charset="utf-8"
Hi,
yeah it definitely does build for x64. That's what I use mostly, in fact.
I think the 64 bit compilers don't come as part of visual studio express.
You can get them as part of the windows sdk download from msdn though.
You
might struggle to get it to work with distutils/setup tools as they
expect
the compiler to be installed as part of visual studio. What you'll need
to
do is start a prompt with all the compiler stuff setup and set the env
var
DISTUTILS_USE_SDK=1 to tell distutils to look at the current environment
for the compiler instead of the registry.
cheers,
Tony
Hey Tony,
Thanks for your fast reply.
Your answer got setupwin.py to build for me, but only with Python 3.4
32-bit.
File "C:\Python341\Lib\distutils\msvc9compiler.py", line 287, in
query_vcvarsall
raise ValueError(str(list(result.keys())))
I am assuming that this is a compiler error because it doesn't have a
64-bit compiling function. I used the same compiler at the 32-bit build
with was Visual C++ 2010 Express. And I also tried Visual Studio 2012
Express too. (Making sure to adjust my environment path accordingly.)
I just want to confirm that this is indeed a compiler issue and doesn't
have to do with the pythonnet code itself.
Thanks,
Beckett
Date: Fri, 13 Jun 2014 18:42:32 +0100
To: "A list for users and developers of Python for .NET"
Subject: Re: [Python.NET] Python 3.4 Support
<javascript:_e(%7B%7D,'cvml','
');>
Content-Type: text/plain; charset="utf-8"
Hi,
use setupwin.py instead of setup.py in the renshawbay repo to build
it.
cheers,
Tony
On Fri, Jun 13, 2014 at 5:18 PM, Beckett Simmons <
Hello all,
I am trying to get pythonnet to build with python 3.4. I am on a
Windows 7
64-bit machine and specifically want to use Python 3.4.1.
Of course the official repository on github does not support
python 3.4
yet.
I've tried this fork here: https://github.com/renshawbay/pythonnet
But that is not working for me. Running setup.py give me this
ValueError: close_fds is not supported on Windows platforms if you
redirect stdin/stdout/stderr
Also, checked out
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pythonnet
for
a Windows precompiled binary, but they only have the python 3.3
version
there.
Any other ideas or ways I could use pythonnet with Python 3.4?
Beckett
_________________________________________________
https://mail.python.org/mailman/listinfo/pythondotnet
Tony Roberts
2014-06-19 08:25:10 UTC
Permalink
Hi Becket,

you just need to uninstall/delete the pythonnet egg you have installed.
When it was installed as an egg it would have been added to your
easy-install.pth file in site-packages, and so that egg is being picked up
before the new version even though the new version is on the python path.
Deleting the old egg folder is the easier way to ensure it doesn't get
imported by mistake.

If you want to install your build into your virtualenv you can use the
Post by Beckett Simmons
python setupwin.py install
Or you can build an egg using 'setupegg.py' and install it that way (which
is convenient as it installs it in its own sub-folder in site-packages so
Post by Beckett Simmons
python setupegg.py bdist_egg
easy_install dist\pythonnet.<version info>.egg
The setup.py in the main repo is cleaner, and we will eventually get the
python3 changes merged into that :)

cheers,
Tony
Post by Beckett Simmons
Hey Tony,
Following your advice I did a simple git reset and git clean to get back
to the original source. Built pythonnet again.
Now a weird thing is happening. I can import clr in the Mircrosoft Windows
7 x64 Debug Build Environment prompt but only immediately after the build.
So I figure out that it was because I was in the pythonnet folder and that
allows it to find the Python.Runtime.dll file at
pythonnet\build\lib.win-amd64-3.4. I tried to to add multiple variations of
that path to my system environment path. This did not work for me with any
variation.
What I had to do to get clr to import was to move that Python.Runtime.dll
file into the
H:\py341Test\Lib\site-packages\pythonnet-2.0dev-py3.4-win-amd64.egg python
virtual environment.
This works for me, or at least works enough to get my unit tests working.
Although it doesn't seem to be the most elegant solution. Then again, I am
using a third-party fork. Just wondering if you have any further pro tips
about this.
Again, thank you very much for your help!
Beckett
Date: Wed, 18 Jun 2014 19:30:30 +0100
To: "A list for users and developers of Python for .NET"
Subject: Re: [Python.NET] Python 3.4 Support
Content-Type: text/plain; charset="utf-8"
Hi Becket,
hmmm, did you build it for 3.3 previously? The setupwin.py in this repo
doesn't clean before building and re-uses the same target for the
different
python versions so it won't rebuild everything correctly when switching
between python versions. Try deleting all the build folders and re-build.
It's a bit rough and ready; the setup.py in the official repo works
better.
If that doesn't work let me know as I had it working ok (but I'm still
using 3.2 mostly so it hasn't had much testing).
cheers,
Tony
Post by Beckett Simmons
Hey Tony,
Thanks for the help. I was able to build pythonnet with your
instructions.
Post by Beckett Simmons
The issue that I am having now is that pythonnet seems to be build for
python33.
When I try to import clr I get this error and python.exe crashes.
http://pastebin.com/0zcW6nP0
How would I possibly point pythonnet to the correct python34 DLL?
http://pastebin.com/Gb4K5PZS
I would be worth while to note that I am building and running python
on a
Post by Beckett Simmons
virtual environment that comes from a python 3.4.1 64-bit base install.
Would this possibly be the problem?
Beckett
Date: Tue, 17 Jun 2014 22:58:21 +0100
To: "A list for users and developers of Python for .NET"
Subject: Re: [Python.NET] PythonDotNet Digest, Vol 122, Issue 13
Content-Type: text/plain; charset="utf-8"
Hi,
yeah it definitely does build for x64. That's what I use mostly, in
fact.
Post by Beckett Simmons
I think the 64 bit compilers don't come as part of visual studio
express.
Post by Beckett Simmons
You can get them as part of the windows sdk download from msdn
though.
Post by Beckett Simmons
You
might struggle to get it to work with distutils/setup tools as they
expect
the compiler to be installed as part of visual studio. What you'll
need
Post by Beckett Simmons
to
do is start a prompt with all the compiler stuff setup and set the
env
Post by Beckett Simmons
var
DISTUTILS_USE_SDK=1 to tell distutils to look at the current
environment
Post by Beckett Simmons
for the compiler instead of the registry.
cheers,
Tony
On Tuesday, June 17, 2014, Beckett Simmons <
Post by Beckett Simmons
Hey Tony,
Thanks for your fast reply.
Your answer got setupwin.py to build for me, but only with Python
3.4
Post by Beckett Simmons
Post by Beckett Simmons
32-bit.
File "C:\Python341\Lib\distutils\msvc9compiler.py", line 287, in
query_vcvarsall
raise ValueError(str(list(result.keys())))
I am assuming that this is a compiler error because it doesn't
have a
Post by Beckett Simmons
Post by Beckett Simmons
64-bit compiling function. I used the same compiler at the 32-bit
build
Post by Beckett Simmons
Post by Beckett Simmons
with was Visual C++ 2010 Express. And I also tried Visual Studio
2012
Post by Beckett Simmons
Post by Beckett Simmons
Express too. (Making sure to adjust my environment path
accordingly.)
Post by Beckett Simmons
Post by Beckett Simmons
I just want to confirm that this is indeed a compiler issue and
doesn't
Post by Beckett Simmons
Post by Beckett Simmons
have to do with the pythonnet code itself.
Thanks,
Beckett
Date: Fri, 13 Jun 2014 18:42:32 +0100
To: "A list for users and developers of Python for .NET"
Subject: Re: [Python.NET] Python 3.4 Support
<
<javascript:_e(%7B%7D,'cvml','
Post by Beckett Simmons
<javascript:_e(%7B%7D,'cvml','
<javascript:_e(%7B%7D,'cvml','
');>
Post by Beckett Simmons
Content-Type: text/plain; charset="utf-8"
Hi,
use setupwin.py instead of setup.py in the renshawbay repo to
build
Post by Beckett Simmons
it.
Post by Beckett Simmons
cheers,
Tony
On Fri, Jun 13, 2014 at 5:18 PM, Beckett Simmons <
Hello all,
I am trying to get pythonnet to build with python 3.4. I am on
a
Post by Beckett Simmons
Post by Beckett Simmons
Windows 7
64-bit machine and specifically want to use Python 3.4.1.
Of course the official repository on github does not support
python 3.4
Post by Beckett Simmons
yet.
https://github.com/renshawbay/pythonnet
Post by Beckett Simmons
Post by Beckett Simmons
But that is not working for me. Running setup.py give me this
ValueError: close_fds is not supported on Windows platforms if
you
Post by Beckett Simmons
Post by Beckett Simmons
redirect stdin/stdout/stderr
Also, checked out
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pythonnet
Post by Beckett Simmons
for
a Windows precompiled binary, but they only have the python 3.3
version
Post by Beckett Simmons
there.
Any other ideas or ways I could use pythonnet with Python 3.4?
Beckett
_________________________________________________
https://mail.python.org/mailman/listinfo/pythondotnet
_________________________________________________
https://mail.python.org/mailman/listinfo/pythondotnet
Loading...