Python exe crashes when running - python

I'm running a Python executable file on my PC. I created it using cx_freeze. I ran it and I am getting the following errors:
H:\>cmd /K C:\Executables\Minneapolis\build\exe.win-amd64-3.7\MinneapolisDiscovery.exe
Traceback (most recent call last):
File "C:\Python37\lib\cx_Freeze\initscripts\__startup__.py", line 40, in run
module.run()
File "C:\Python37\lib\cx_Freeze\initscripts\Console.py", line 23, in run
exec(code, {'__name__': '__main__'})
File "MinneapolisDiscovery.py", line 1, in <module>
File "C:\Python37\lib\requests\__init__.py", line 43, in <module>
import urllib3
File "C:\Python37\lib\urllib3\__init__.py", line 8, in <module>
from .connectionpool import (
File "C:\Python37\lib\urllib3\connectionpool.py", line 28, in <module>
from .packages.six.moves import queue
File "C:\Python37\lib\urllib3\packages\six.py", line 92, in __get__
result = self._resolve()
File "C:\Python37\lib\urllib3\packages\six.py", line 115, in _resolve
return _import_module(self.mod)
File "C:\Python37\lib\urllib3\packages\six.py", line 82, in _import_module
__import__(name)
ModuleNotFoundError: No module named 'queue'
It looks like something related to urllib3 or requests, but I've never gotten this error before. Any ideas on what I need to do to get this exe file to run?

Related

Python No module named 'Input'

my error is
Traceback (most recent call last):
File "/home/shin/.local/bin/fextractor", line 4, in <module>
__import__('pkg_resources').run_script('VDiscover==0.1', 'fextractor')
File "/home/shin/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 672, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/home/shin/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1472, in run_script
exec(code, namespace, namespace)
File "/home/shin/.local/lib/python3.8/site-packages/VDiscover-0.1-py3.8.egg/EGG-INFO/scripts/fextractor", line 28, in <module>
from vdiscover.Detection import GetArgs, GetFiles, GetCmd
File "/home/shin/.local/lib/python3.8/site-packages/VDiscover-0.1-py3.8.egg/vdiscover/Detection.py", line 24, in <module>
from Input import Arg, File
ModuleNotFoundError: No module named 'Input'
I think it is related to the input library, so I did pip install input and added the path(./.local/lib/python3.8/site-packages) to the PATH.
But it seems to be a different issue. Could I possibly know a solution?

Ovirt Python SDK error during openuds installation

I get the following error, How to rectify this issue?
from ovirtsdk.xml import params
ImportError: No module named ovirtsdk.xml
This is the complete log file, Why I get this error and How to rectify it?
python manage.py createcachetable
Traceback (most recent call last):
File "manage.py", line 9, in <module>
execute_from_command_line(sys.argv)
File "/home/hari/openuds/testuds-master/Python-2.7.14/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/home/hari/openuds/testuds-master/Python-2.7.14/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 327, in execute
django.setup()
File "/home/hari/openuds/testuds-master/Python-2.7.14/env/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/hari/openuds/testuds-master/Python-2.7.14/env/lib/python2.7/site-packages/django/apps/registry.py", line 115, in populate
app_config.ready()
File "/home/hari/openuds/testuds-master/server/src/uds/__init__.py", line 72, in ready
from . import services # to make sure that the packages are initialized at this point
File "/home/hari/openuds/testuds-master/server/src/uds/services/__init__.py", line 73, in <module>
__init__()
File "/home/hari/openuds/testuds-master/server/src/uds/services/__init__.py", line 63, in __init__
__import__('uds.services.' + name, globals(), locals(), [])
File "/home/hari/openuds/testuds-master/server/src/uds/services/OVirt/__init__.py", line 31, in <module>
from .OVirtProvider import Provider
File "/home/hari/openuds/testuds-master/server/src/uds/services/OVirt/OVirtProvider.py", line 44, in <module>
from . import client
File "/home/hari/openuds/testuds-master/server/src/uds/services/OVirt/client/__init__.py", line 33, in <module>
from . import oVirtClient3;
File "/home/hari/openuds/testuds-master/server/src/uds/services/OVirt/client/oVirtClient3.py", line 7, in <module>
from ovirtsdk.xml import params
ImportError: No module named ovirtsdk.xml
You are missing the ovirt-engine-sdk-python package. Note that it requires version 3 of that package, so you can install it via pip like this:
$ pip install ovirt-engine-sdk-python==3.6.9.2
Don't run:
$ pip install ovirt-engine-sdk-python
which would install latest(4) version of the SDK, which isn't compatible with above code.

Getting Error While running manage.py ...import Error cannot import name backend

Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/devbase/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/home/devbase/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute
django.setup()
File "/home/devbase/env/local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/devbase/env/local/lib/python2.7/site-packages/django/apps/registry .py", line 85, in populate
app_config = AppConfig.create(entry)
File "/home/devbase/env/local/lib/python2.7/site-packages/django/apps/config.p y", line 94, in create
module = import_module(entry)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/devbase/env/local/lib/python2.7/site-packages/djorm_pgtrgm/__init_ _.py", line 1, in <module>
from django.db import backend
ImportError: cannot import name backend
It looks like you are using djorm_pgtrgm. It hasn't been updated for two years, so you can't expect it to work with recent versions of Django.
This merged pull request suggests that the import error has been fixed in the GitHub repo, but there hasn't been a release since then. You could try installing from source, but you should think about whether you want to use an unmaintained package in your project.

Django gmane Syntax error

Traceback (most recent call last):
File "manage.py", line 10, in <module> execute_from_command_line(sys.argv)
File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 350, in execute_from_command_line
utility.execute()
File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 324, in execute
django.setup()
File "/Library/Python/2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Library/Python/2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/Library/Python/2.7/site-packages/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/Library/Python/2.7/site-packages/social/__init__.py", line 5, in <module>
from .fsong import *
File "/Library/Python/2.7/site-packages/social/fsong.py", line 1, in <module>
import gmane as g, networkx as x, pylab as p, numpy as n, os
File "/Library/Python/2.7/site-packages/gmane/__init__.py", line 26, in <module>
from .networkEvolution import NetworkEvolution
File "/Library/Python/2.7/site-packages/gmane/networkEvolution.py", line 9, in <module>
from .pca import *
File "/Library/Python/2.7/site-packages/gmane/pca.py", line 79
def __init__(self,*metrics,final_dimensions=2,draw=False):
SyntaxError: invalid syntax
I have installed django using pip and trying to run python manage.py migrate. I am facing the above error. Any one have faced this before? I am using OSX and python version is 2.7.10, Django version 1.9

python fabric error 'module' object has no attribute 'HAVE_DECL_MPZ_POWM_SEC'

I am getting following error when I run fabric
(ENV)[root#server-124 ENV]# fab
Traceback (most recent call last):
File "/usr/bin/fab", line 9, in <module>
load_entry_point('Fabric==1.8.3', 'console_scripts', 'fab')()
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 299, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2229, in load_entry_point
return ep.load()
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1948, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/lib/python2.6/site-packages/fabric/main.py", line 19, in <module>
from fabric import api, state, colors
File "/usr/lib/python2.6/site-packages/fabric/api.py", line 9, in <module>
from fabric.context_managers import (cd, hide, settings, show, path, prefix,
File "/usr/lib/python2.6/site-packages/fabric/context_managers.py", line 42, in <module>
from fabric.state import output, win32, connections, env
File "/usr/lib/python2.6/site-packages/fabric/state.py", line 9, in <module>
from fabric.network import HostConnectionCache, ssh
File "/usr/lib/python2.6/site-packages/fabric/network.py", line 24, in <module>
import paramiko as ssh
File "/usr/lib/python2.6/site-packages/paramiko/__init__.py", line 31, in <module>
from transport import SecurityOptions, Transport
File "/usr/lib/python2.6/site-packages/paramiko/transport.py", line 33, in <module>
from paramiko import util
File "/usr/lib/python2.6/site-packages/paramiko/util.py", line 33, in <module>
from paramiko.common import *
File "/usr/lib/python2.6/site-packages/paramiko/common.py", line 98, in <module>
from Crypto import Random
File "/usr/lib64/python2.6/site-packages/Crypto/Random/__init__.py", line 29, in <module>
from Crypto.Random import _UserFriendlyRNG
File "/usr/lib64/python2.6/site-packages/Crypto/Random/_UserFriendlyRNG.py", line 38, in <module>
from Crypto.Random.Fortuna import FortunaAccumulator
File "/usr/lib64/python2.6/site-packages/Crypto/Random/Fortuna/FortunaAccumulator.py", line 39, in <module>
import FortunaGenerator
File "/usr/lib64/python2.6/site-packages/Crypto/Random/Fortuna/FortunaGenerator.py", line 34, in <module>
from Crypto.Util.number import ceil_shift, exact_log2, exact_div
File "/usr/lib64/python2.6/site-packages/Crypto/Util/number.py", line 56, in <module>
if _fastmath is not None and not _fastmath.HAVE_DECL_MPZ_POWM_SEC:
AttributeError: 'module' object has no attribute 'HAVE_DECL_MPZ_POWM_SEC'
I have referred some other post that says it "so you'reusing a newer version of PyCrypto with an older version of _fastmath." So I also installed gmp-devel
I am using virtualenv , Centos 6, Python 2.6
please help.
This fixed it for me:
pip install PyCrypto==2.3
I didn't uninstall python-crypto because other packages I needed depended on it. I just ran the pip command above and everything worked :)

Categories