py2exe suddenly no longer working. No module named _view - python

Running an exe compiled in py2exe is now giving me this error:
C:\Users\digiholic\git\universalSmashSystem\main.exe\zipextimporter.py:82: RuntimeWarning: import display: No module named _view
(ImportError: No module named _view)
C:\Users\digiholic\git\universalSmashSystem\main.exe\zipextimporter.py:82: RuntimeWarning: import draw: No module named _view
(ImportError: No module named _view)
C:\Users\digiholic\git\universalSmashSystem\main.exe\zipextimporter.py:82: RuntimeWarning: import image: No module named _view
(ImportError: No module named _view)
C:\Users\digiholic\git\universalSmashSystem\main.exe\zipextimporter.py:82: RuntimeWarning: import pixelcopy: No module named _view
(ImportError: No module named _view)
C:\Users\digiholic\git\universalSmashSystem\main.exe\zipextimporter.py:82: RuntimeWarning: import transform: No module named _view
(ImportError: No module named _view)
I did not modify my py2exe file since the last working build, nor have I made any significant changes to my Python installation. I have modified code, which must be causing this issue, but the error message is giving me no information on how to fix it. What could cause this issue?
I have put import pygame._view at the top of my main.py script and it is not helping. I do not reference any system fonts, all fonts used in my code are .ttf files in my package.
EDIT: Searched more. import re is not working either.

The solution is to add import pygame._view to the top of your main source file. Any of the packagers should work after that.
Try to do so. Some similar question was already asked in the past.
Please check also Pygame to exe display module error [duplicate]
and
Opening an EXE of my Pygame program gives me import errors
IF you look at the second answer the problem was in the "font" usage. Maybe you did something similar :-) Try it out and let us know.
Unfortunately I am not personally using pygame module :-( but I guess for the defined _view you have to use the import as you did correctly :-)
Hope this solve your query :-) Have a nice day.

This is looking like a PYTHONPATH issue. You need to verify that all of the locations where these modules are located are either in the development directory itself or in your search path for Python.
You can do a:
print sys.path
to see what is in your search path and validate those modules are in it. It is possible something changed it. Once you verify that, you can add the missing paths using PYTHONPATH.

Related

ImportError: No module named 'kzyvad'

I want to start up a project, which imports a module named kzyvad. It occurs error ImportError: No module named 'kzyvad'. However, if I execute pip install kzyvad, it returns ERROR: Could not find a version that satisfies the requirement kzyvad.
Did someone ever successfully install kzyvad?
I don't know where you found your module but I looked for it and I could not find it, I think the guy who wrote 'kzyvad' did a mistake while writing, and if pip gives you this error, it means it doesn't exist.
If this kzyvad.py is written by you, then keep this file/module in a same folder and do this in main.py file:
from kzyvad import *
You can use it's functions and classes in your main.py file

ModuleNotFoundError: No module named 'pyrouge.utils'; 'pyrouge' is not a package

I have this library in my code:
from pyrouge.utils import log
But I am getting the following error:
ModuleNotFoundError: No module named 'pyrouge.utils';
'pyrouge' is not a package
Though pyrouge in already installed in my system. I tried to find its solution but there are like none results. Can anyone help me here?

No module named 'azure.eventhub'; 'azure' is not a package

I am trying to execute this example using Python 3.7 with Pycharm and azure-eventhub 1.2.0 package.
When I try to run it, I get this error:
ModuleNotFoundError: No module named 'azure.eventhub'; 'azure' is not a package
This is the problematic line:
from azure.eventhub import EventHubClient, Receiver, Offset
What could be happening?
This is my project interpreter
Using pip freeze:
As I known, there is a case which will cause your issue.
The Python Interpreter searches the available packages, objects and methods in the paths of sys.path in order, you can print the value of the sys.path variable to see the order after import sys.
So if there is a Python script named azure.py prior to the real azure package, you will get the issue ModuleNotFoundError: No module named 'azure.eventhub'; 'azure' is not a package.
Here is my steps to reproduce this issue.
I created a Python script named azure.py in the current path which only have one line code print('pseudo azure package').
Then, I opened my Python interpreter in the current path and type from azure.eventhub import EventHubClient, Receiver, Offset, then to get the issue as below.
It also will happen in Pycharm, even using virtualenv, please check whether exists a file called azure.py or azure.pyc in your current path or the paths in the order of sys.path list.

No module named zope.index

Getting the following error when trying to import a lib that depends on zope
No module named zope.index
my python path is correct (I can import other libs)
I already created an init.py file in the zope folder but it still isnt working so Im not sure what I might be missing
currently using python 3.7
*edit
Error:
File "C:\Users\vitor.valentim\AppData\Local\Programs\Python\Python37\Lib\dedupe\tfidf.py", line 5, in
from .canopy_index import CanopyIndex
File "C:\Users\vitor.valentim\AppData\Local\Programs\Python\Python37\Lib\dedupe\canopy_index.py", line 3, in
from zope.index.text.lexicon import Lexicon
ModuleNotFoundError: No module named 'zope.index'
zope path
zope.index path
The error message No module named zope.index implies that import found a package zope, but then failed to find zope.index (otherwise the error message would be No module named zope).
Try
import zope
print(zope)
and see what that resolves to, something like this often happens if there is something shadowing the package you're trying to import.

Scrapy, pyinstaller, and missing modules galore

I'm developing a scrapy program in python 2.7 to scrape data off of nhtsa.gov. It works great in command line, but I want to package it into a single file application so I'm using pyinstaller. Pyinstaller creates an application file, but when run it says "Fatal Error! NHTSAscrape returned -1". When I go into the warning log file, there are like a hundred missing modules, modules that I've never even heard of:
missing module named posix - imported by os
missing module named codecs.mbcs_encode - imported by codecs, encodings.mbcs
missing module named codecs.mbcs_decode - imported by codecs, encodings.mbcs
missing module named datetime.date - imported by datetime, _strptime,
missing module named 'six.moves.urllib' - imported by 'six.moves.urllib',
missing module named _xmlrpclib - imported by xmlrpclib,
missing module named twisted.version - imported by twisted, scrapy,
missing module named cStringIO.InputType - imported by cStringIO, twisted.python.compat, twisted.persisted.styles
missing module named cStringIO.OutputType - imported by cStringIO, twisted.python.compat, twisted.persisted.styles
missing module named 'urllib.parse' - imported by twisted.python.compat, lxml.html, twisted.web.http
...and many more. I am now running my spec file to create the application, and trying to edit the "hiddenimports" and "excludes" fields, but this doesn't really change anything. For instance, if I say
excludes=['posix','codecs','codecs.mbcs_encode']
The warning log file gives the same as above, but adds "excluded module posix" etc, but it doesn't seem to actually exclude the module.
There must be an easier way to take care of all of these missing modules, or some reason that all of these modules are being referenced even though my program doesn't use them.
I can post the full log file if anyone is interested. Thoughts?

Categories

Resources