importerror

PyInstaller, spec file, ImportError: No module named 'blah'

烈酒焚心 提交于 2019-11-28 20:42:08
I am trying to build a python script via PyInstaller . I have used the following commands to configure, generate a spec file, and build: wget pyinstaller.zip, extracted it, python Configure.py, etc, then: python pyinstaller/Makespec.py --onefile myscript.py python pyinstaller/Build.py myscript.spec Here is the spec file it generated: # -*- mode: python -*- a = Analysis([os.path.join(HOMEPATH,'support/_mountzlib.py'), os.path.join(HOMEPATH,'support/useUnicode.py'), 'icinga.py'], pathex=['/home/user/projects/icinga_python/releases/v2.1']) pyz = PYZ(a.pure) exe = EXE( pyz, a.scripts, a.binaries,

Scapy installation fails on osx with dnet import error

一个人想着一个人 提交于 2019-11-28 20:22:22
问题 Having trouble installing Scapy and it's required dependancies. I have spent some time Googling for a solution but all 'solutions' seem to affect older versions of Python, or simply do not work. Script: #!/usr/bin/python import threading import Queue import time from scapy.all import * class WorkerThread(threading.Thread) : def __init__(self, queue, tid) : threading.Thread.__init__(self) self.queue = queue self.tid = tid print 'Worker: %d' %self.tid def run(self) : total_ports = 0 while True

What could cause a Django error when debug=False that isn't there when debug=True

霸气de小男生 提交于 2019-11-28 19:13:56
问题 Using the development server, it works with debug=True or False. In production, everything works if debug=True, but if debug=False, I get a 500 error and the apache logs end with an import error: "ImportError: cannot import name Project". Nothing in the import does anything conditional on debug - the only code that does is whether the development server should serve static files or not (in production, apache should handle this - and this is tested separately and works fine). 回答1: This happens

ImportError: No module named Cython.Distutils

安稳与你 提交于 2019-11-28 18:07:00
I'm having a strange problem while trying to install the Python library zenlib , using its setup.py file. When I run the setup.py file, I get an import error, saying ImportError: No module named Cython.Distutils` but I do have such a module, and I can import it on the python command line without any trouble. Why might I be getting this import error? I think that the problem may have to do with the fact that I am using Enthought Python Distribution , which I installed right beforehand, rather than using the Python 2.7 that came with Ubuntu 12.04. More background: Here's exactly what I get when

Python ImportError: No module named 'requests' after confirming install

佐手、 提交于 2019-11-28 12:28:56
问题 I'm new to python and set up a few things in terminal and am now trying to run python code in Atom. My first three lines in my code editor are: import re import requests import robobrowser When I run the code I keep getting the ImportError: No module named robobrowser I'm assuming it has to do with the path or placement of my files, but I'm not sure how to check that. Versions I'm running in terminal: (prot) MacBook:prot myname$ python --version Python 3.7.3 (prot) MacBook:prot myname$ pip -

Import Error. Circular References

浪子不回头ぞ 提交于 2019-11-28 11:35:52
I have a package like this package/ __init__.py subpackage1/ __init__.py moduleA.py moduleB.py moduleC.py moduleD.py subpackage2/ __init__.py moduleX.py moduleY.py moduleZ.py In moduleB.py, I am importing from moduleA import bar In moduleA, I am importing from moduleB import foo I am getting ImportError. ImportError: cannot import name foo What could be the problem here ? and to avoid this problem, what should I do ? and what should I write in _ init _ .py pf package, subpackage1, subpackage2 ? _ init _ .py of subpackage1 from moduleA import * from moduleB import * from moudleC import * from

Mac - Python - import error: “No module named site”

╄→尐↘猪︶ㄣ 提交于 2019-11-28 11:13:18
Tonight I am trying to get the package called "requests" installed and have begun fumbling around with the terminal and do not have very much intuition when it comes to this sort of thing. Computer is a mac mini, osx version 10.9.4 In /Library/Python I have 4 folders: 2.3 2.5 2.6 and 2.7. In /Applications I have "Python 2.7" and "Python 3.4" I can open IDLE and type 8+8 and I get 16 just fine. Here is the error I am getting in terminal: host-210-117:~ Mario$ python ImportError: No module named site host-210-117:~ Mario$ pip ImportError: No module named site My goal is to run this command in

Setting up a virtualenv: No module named 'pip'

泄露秘密 提交于 2019-11-28 09:09:30
I have a fresh install of Python 3.3.4 on a Windows Server 2008 R2 machine. I've successfully installed the latest versions of Setuptools, Pip and Virtualenv globally: python ez_setup.py easy_install pip pip install virtualenv Now when I try to set up a virtualenv using virtualenv ENV I get the following stack trace: New python executable in ENV\Scripts\python.exe Installing setuptools, pip... Complete output from command [path redacted]\ENV\Scripts\python.exe -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip: Traceback (most recent call last): File "<string>", line 1, in

Django + mod_wsgi + apache: ImportError at / No module named djproj.urls

ⅰ亾dé卋堺 提交于 2019-11-28 08:27:48
I'm trying to deploy my Django application on my linode server with apache and mod_wsgi. file: /srv/www/example.com/djproj/django.wsgi import os import sys sys.path.append('/srv/www/example.com/djproj') os.environ['PYTHON_EGG_CACHE'] = '/srv/www/example.com/.python-egg' os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() file: /etc/apache2/sites-available/example.com /etc/apache2/sites-available/example.com ServerAdmin admin@example.com ServerName example.com ServerAlias www.example.com DocumentRoot /srv/www

Python/IPython ImportError: no module named site

六月ゝ 毕业季﹏ 提交于 2019-11-28 07:29:11
I had python 2.7.3 and ipython 1.2 up and running correctly on my Linux system ( ubuntu 12.04 ) but was trying to install an updated version of matplotlab needed for coursework. After running this code line in the terminal user$ sudo easy_install -U distribute user$ export PYTHONHOME=/usr/lib/python2.7/ now every time I try and run python or ipython I get the error message ImportError: no module named site how do I reverse/fix this problem?? I'm so lost. I looked at other similar issues, but no one else used Linux and I'm not sure what to do. TRY to unset your python path... In Linux/Mac, you