I had the same problem and the following fix in the file
runtime/assemblymanager.cs made things work for me. I believe the problem is
that on Win 8.1 there seem to be generic types that aren't in a namespace.
My patch just skips those and thus prevents a crash. I am not sure whether
that is the right way to handle it, but it does fix the crash.
Best,
David
diff --git a/pythonnet/src/runtime/assemblymanager.cs
b/pythonnet/src/runtime/assemblymanager.cs
index 80c838d..2d369b5 100644
--- a/pythonnet/src/runtime/assemblymanager.cs
+++ b/pythonnet/src/runtime/assemblymanager.cs
@@ -283,7 +283,7 @@ internal class AssemblyManager {
namespaces[ns].Add(assembly, String.Empty);
}
- if (t.IsGenericTypeDefinition) {
+ if (ns !=null && t.IsGenericTypeDefinition) {
GenericUtil.Register(t);
}
}
From: PythonDotNet [mailto:pythondotnet-bounces+btribble=ea.com at
python.org] On Behalf Of Mihhail Maslakov
Sent: Wed Nov 6 11:27:45 CET 2013
To: pythondotnet at python.org
Subject: [Python.NET] Python .NET on Windows 8.1
I have been using python.net for about 5 years for my project at work.
Usually everything worked or at least there was a way to fix it. Right now,
there is a situation, that I cannot understand.
Since my PC got upgraded from W7 to W8.1 imports stopped working. It seems
that something happens on clr module initialization stage, because when I
try clr.AddReference("...") python answers: "AttributeError: 'module'
object has no attribute 'AddReference'"
When debugging with freshly built clr.pyd/Python.Runtime.dll I see that
Runtime.Initialize() finishes without exception and clr module methods are
added via InitializeModuleMembers(). Yet still, when I run my program clr
doesn't work properly and seems like import hooks are not there
(breakpoints at AddReference and other methods are not fired).
Do you have any pointers for me in this situation?
Thank you,
Mihhail Maslakov
Hi all,
I got an ok from Brian and Barton on the github migration, so please
consider https://github.com/pythonnet/pythonnet the new home for this
project.
Please do use the issue tracker to file your ideas, fork the project, create
pull requests, test the current version etc. Hopefully we can revive this
project!
If you would want to volunteer with reviewing stuff etc, please let me know,
I myself don't know the codebase well, so right now I'm just trying to get
things moving again but it would be good if someone with more familiarity
with the code would be active as well.
My immediate next goal would be to release a stable version. So my sense is
that we should not try to do new features, but first get something out that
works again.
Best,
David
--
David Anthoff
University of California, Berkeley
http://www.david-anthoff.com
When will you release a new build that works on Windows 8.1? I saw some emails in the list archive, but was wondering if anyone had worked out a more concrete plan?
Regards,
Alan Copeland
Agilent Technologies, Inc.
Alright, I started this now. I created the github organization and the repo.
I will also have a stab at migrating the svn history.
I've marked the github repo as experimental for now so that it is clear that
at this point it is not the official source (yet).
I'll keep the list updated as I make progress.
Cheers,
David
From: PythonDotNet
[mailto:pythondotnet-bounces+davidacoder=hotmail.com@python.org] On Behalf
Of Tony Roberts
Sent: Wednesday, November 27, 2013 6:04 AM
To: pythondotnet(a)python.org
Subject: Re: [Python.NET] PTVS and python.NET
Hi David,
that would seem to fit with the way most other projects work, and should
make it easier for anyone looking for the project on github to find it.
I'm happy to help out with the migration and maintenance if it is decided to
go ahead with this. The fork I created doesn't have the history from svn, so
I think it would be better to start again with the sourceforge project and
pull it into git with all the history and then merge in the various changes
already in github.
cheers,
Tony
On Wed, Nov 27, 2013 at 3:21 AM, davidacoder <davidacoder(a)hotmail.com
<mailto:davidacoder@hotmail.com> > wrote:
I guess my preferred option would be to create a github organization and
host the repo there. So something like github.com/pythonnet/pythonnet
<http://github.com/pythonnet/pythonnet> . In that case the organization can
have multiple owners, so the whole thing is also less dependent on one
person.
If, on the other hand, one of the original maintainers wanted to host it
under their account, I would also understand that, i.e. if this is really
someone's baby.
Finally, I guess the official short name is "pythonnet", right? Or
"pythondotnet", like the mailing list alias?
Cheers,
David
From: Tribble, Brett [mailto:btribble@ea.com <mailto:btribble@ea.com> ]
Sent: Tuesday, November 26, 2013 5:36 PM
To: davidacoder; pythondotnet(a)python.org <mailto:pythondotnet@python.org> ;
brian.lloyd(a)revolution.com <mailto:brian.lloyd@revolution.com>
Subject: RE: [Python.NET] PTVS and python.NET
So, who is willing to be the primary maintainer of the github repository? I
think we should wait for a little while to see if Brian or Barton respond. I
see that tiran has a github account as well: https://github.com/tiran
From: PythonDotNet [mailto:pythondotnet-bounces+btribble=ea.com@python.org]
On Behalf Of davidacoder
Sent: Tuesday, November 26, 2013 6:37 AM
To: pythondotnet(a)python.org <mailto:pythondotnet@python.org>
Subject: Re: [Python.NET] PTVS and python.NET
Great idea!
Best,
David
From: PythonDotNet
[mailto:pythondotnet-bounces+davidacoder=hotmail.com@python.org] On Behalf
Of John Gill
Sent: Tuesday, November 26, 2013 7:47 AM
To: pythondotnet(a)python.org <mailto:pythondotnet@python.org>
Subject: [Python.NET] PTVS and python.NET
Related to a move to github, I have been in touch with the maintainer of
PTVS asking if they are aware of this project. It seems such a natural fit.
He would be happy to:
1. Put a link on our "Related projects" page
2. Identify some interesting scenarios and do a blog post
3. Add a dedicated doc page
4. Etc.
Subject to:
1. The project is actively maintained
2. Up to date docs
3. It "works"
a. Reliable & robust
b. Works with PTVS (eg PTVS doesn't crash, .)
It would be great if PTVS was able to install python .NET for people (the
current install process "copy these dll's" is simple and effective, but a
direct install from PTVS would be good.
I think we would need to resolve the current situation with the code split
between github and sourceforge before we could get the endorsement from
PTVS.
John
This communication and any attachments contain information which is
confidential and may also be legally privileged. It is for the exclusive use
of the intended recipient(s). If you are not the intended recipient(s)
please note that any form of disclosure, distribution, copying, printing or
use of this communication or the information in it or in any attachments is
strictly prohibited and may be unlawful. If you have received this
communication in error, please return it with the title "received in error"
to postmaster(a)tokiomillennium.com <mailto:postmaster@tokiomillennium.com>
and then permanently delete the email and any attachments from your system.
E-mail communications cannot be guaranteed to be secure or error free, as
information could be intercepted, corrupted, amended, lost, destroyed,
arrive late or incomplete, or contain viruses. It is the recipient's
responsibility to ensure that e-mail transmissions and any attachments are
virus free. We do not accept liability for any damages or other consequences
caused by information that is intercepted, corrupted, amended, lost,
destroyed, arrives late or incomplete or contains viruses.
******************************************
_________________________________________________
Python.NET mailing list - PythonDotNet(a)python.org
<mailto:PythonDotNet@python.org>
https://mail.python.org/mailman/listinfo/pythondotnet
I tried to get PythonNet working on a Windows 7 machine with Python 2.6.6 installed. My test program is very simple:
print "before import of clr"
import clr
print "done importing clr"
When I run the above in Pythonwin, I get this error:
ImportError: dynamic module does not define init function (initclr)
I have these packages installed (names of the installers are listed here):
python-2.6.6.msi (we must use 2.6 because of an application dependency --> Aveva Marine)
pywin32-214.win32-py2.6.exe
wxPython2.8-win32-ansi-2.8.9.2-py26.exe (and we must use wx......ansi-2.8.9.2..... because it's the only one that works in Aveva Marine 12.1.4)
I retrieved this zip file from the PythonNet site (on sourceforge):
pythonnet-2.0-alpha2-136-py26.zip
And unzipped it and placed the contents of the UCS2 sub-directory (except for the python.exe) in the C:\python26 directory. (Including the clr.pyd and the Python.Runtime.dll). The simple test program I have above is also in the C:\python26 directory. And the PYTHONPATH environment variable contains C:\python26 (and a few other folders/directories).
But I can't even get the first real statement - import clr - to work.
I apologize if this ends up being a complete newbie question.
If you have any ideas on what I'm missing, I would be extremely grateful.
Johan Vinke
GD-Nassco