The following modules appear to be missing ['_sysconfigdata']

dude.jimbo at gmail.com dude.jimbo at gmail.com
Wed Jan 9 08:42:20 EST 2019


On Wednesday, January 9, 2019 at 6:06:35 AM UTC+1, Matthew Lemon wrote:
> Hi,
> 
> I would start from scratch with this.
> 
> 1. You have latest Python 2 version.
> 2. Use virtualenv to create and activate a new virtual environment.
> 3. pip install wxPython and other dependencies.
> 4. Get your application running from the command line first and follow up any DLL exceptions.
> 5. Use pyinstaller (https://pyinstaller.readthedocs.io/en/stable/) to create a new exe file once you know everything works. 
> 
> Matt
> 
> On 8 January 2019 10:38:16 GMT, I wrote:
> >Hello,
> >
> >first time using python groups (and long time since using any other
> >group for that matter). This might not be the right group due to wx
> >being involved.
> >
> >Long story as short as possible. I have an old python script that I did
> >~10 years ago, and have forgotten basically everything about Python
> >since then (sorry!). Converted it to EXE way back when, and have kept
> >using the EXE ever since then (on XP, and on Win7).
> >
> >I've just gotten a new PC, Windows10 (!), needed to update the script,
> >so needed to recompile the EXE, and now it no longer compiles/works. It
> >was fine on Windows7 (I'm not specifically stating that the problem is
> >with windows10 - I simply don't remember all the hoops I jumped through
> >on my previous machine).
> >
> >Here is the compile error:
> >The following modules appear to be missing
> >['_sysconfigdata']
> >
> >And here is the runtime error:
> >Traceback (most recent call last):
> >  File "AutoArchive.py", line 3, in <module>
> >  File "wx\__init__.pyc", line 45, in <module>
> >  File "wx\_core.pyc", line 4, in <module>
> >  File "wx\_core_.pyc", line 12, in <module>
> >  File "wx\_core_.pyc", line 10, in __load
> >ImportError: DLL load failed: %1 is not a valid Win32 application.
> >
> >Here is how I compile: python setup.py py2exe
> >
> >And this is my setup.py:
> >from distutils.core import setup
> >import py2exe
> >
> >setup(console=['AutoArchive.py'])
> >
> >Yes, that says 'console' for a Windows EXE, but swapping it to 'window'
> >didn't help. Besides which, the setup.py file is straight from the old
> >computer, so 'it used to work'.
> >
> >What I have installed:
> >. python 2.7.13 (this in itself may be a problem - I don't even
> >remember which version I was using earlier, other than knowing for sure
> >it wasn't a 3.x release)
> >. wxpython  (since I also got an error that wx module was missing -
> >that rang some bells, since the script uses a Windows pop-up window to
> >inform me about its progress, and I remember using wx for that, so I
> >installed it, but don't know how to get its' version. using "python -c
> >"import wx;print wx.__version__" just gives runtime errors).
> >
> >Any help would be appreciated.
> >
> >And yes, I googled, but can't really find anything (well, d'Uh!, I
> >wouldn’t be here then would I?) - there's ~some~ references, but
> >usually it's about similar issues on Linux, with solutions that are not
> >applicable at all. Except one I thought: I found some link stating that
> >_sysconfigdata is part of sysconfig, and that this needed to be
> >installed with pip, so I used the pip that came with my python distro
> >and did 'pip install [[_]sys]config[data]' (all possible combo's) but
> >pip claims it can't find said module, and TBH, I can't seem to find
> >anything myself about said module.
> >
> >Thx,
> >Jimbo
> >-- 
> >https://mail.python.org/mailman/listinfo/python-list
> 
> -- 
> Sent from my Android device

Thx for your feedback. I am a tad afraid you're giving me a bit too much credit though; it's all a bit Chinese to me. (I'm not Chinese, BTW, but I'm not making up these expressions myself so there's that).

Step 2 you've lost me already. What is virtualenv, and why do I need it (this time round, not last time when I got it to work)? You don’t really need to respond, this is more of a rethorical question :).

Step 3 is I think the real issue. At first I was missing 'wx' and '_sysconfigdata', so I installed wxPhyton (via a windows installer that I found, not with pip), and that made the compile error go away (though it still throws runtime errors, of course). But what is '_sysconfigdata', and how do I install it? I - and pip :) - can't find a repo with that name!?

step 5, pyinstaller, is yet another hurdle I hope to avoid. It worked with py2exe, and it should still work with py2exe (within the efforts I'm prepared to put into this). Of course py2exe might be ancient and horrible and a bunch of other things that pyinstaller is not (I woulnd't know either way), but, to be honest, as well a tad cocky, I am not interested nor prepared to find out. Sorry about that, but hopefully one can understand. I'm not trying to 'get back into Python' , I just want something from the past back working again with minimal effort.

Trying to get it to work in console sounds like a (backup) plan though. I don't really need the 'progress' popup window, so I could keep the script in console only. That would potentially circumvent the issues, but I would have preferred if I simply got it back to work as is, like I managed to do - when I was still a bit more 'fluent' in Python - way back when on my previous machine…



More information about the Python-list mailing list