Tried removing the part that used pyWinhook from the project, and I got it running.
Anyone know how to fix it ?
Tried hidden import, but did not help..
File "ScreenShot.py", line 1, in
ModuleNotFoundError: No module named 'pyWinhook'
Problem was to do with Swig files, downloaded the swig files and copied it to the python source folders.
you need to install that module using
pip install pyWinhook
Related
I am attempting to load a Jupyter Notebook through mybinder.org. The repository that the Notebook is in includes a requirements.txt file with the content
parsl
because the Notebook uses the parsl library.
When I load the notebook and import the library, execution stops with the error
ModuleNotFoundError: No module named 'parsl'
The requirements.txt file is right there. I have no idea what else to do to get mybinder.org to load the module. What am I missing?
Without seeing the repo you are referring to, one suggestion would be you don't have your requirements.txt where it needs to be. If it isn't in the root directory of the repository, it has to be in a folder named binder, see here.
There is a repo that has parsl working. You can fork the repo from here, or alternatively you use https://github.com/Parsl/parsl-tutorial as a basis to make your own and then add in your notebooks.
I am trying to simply connect to the ibapi (Interactive Brokers API), but I am having some technical troubles with Spyder.
What I did so far:
I installed the latest version for Windows from here
I provided the following path to the PYTHONPATH manager in Spyder: C:\TWS API\source\pythonclient\ibapi afterwards I restarted Spyder
When I simply type import ibapi I get the same error message: ModuleNotFoundError: No module named 'ibapi'
What I am doing wrong here and how can I fix this simple error?
I don't use python very much but I'm pretty sure you have to install the ibapi. I never used the PYTHONPATH and mine works fine in Spyder and Jupyter. I'm using Anaconda.
I run the Anaconda prompt (just activates the conda environment) and navigate to the dir C:\TWS API\source\pythonclient and run python setup.py install
Then everything works. I think many python packages need to be installed like this.
note: That's not my install dir, I just copied yours. There may be a problem with a space in the path. Try renaming to C:\TWSAPI\... if you still have a problem.
Note: after python setup.py install, you might need to restart spyder. If doesn't help, then copy the newly-created ibapi folder to:
C:\Users\iuzeri\AppData\Local\Programs\Python\Python37-32\Lib\site-packages
or
C:\Program Files (x86)\Python37-32\Lib\site-packages
copy your ibapi here
C:/ProgramData/Anaconda3/Lib/site-packages/ibapi
I am attempting to convert a python file to an executable file. Easy enough right?
I used pyinstaller on a simple program that doesn't import anything. It worked like a charm. Then, I tried it with another dummy program with imported modules, (PyQt4, sys, matplotlib) that my actual program would have. Here I encountered problems.
This error appeared when I ran the application in the 'dist' folder pyinstaller created.
Fatal Python error: Py_Initialize: unable to load the file system codec
ImportError: No module named 'encodings'
I found another site with a possible solution to this problem, but his situation wasn't exactly the same: http://code.activestate.com/lists/python-dev/118463/
This lead me to trying the QT designer that I downloaded earlier. Perhaps if I could convert the .ui file it produced into a .py file, I would be fine. I could use his solution and all would be well.
That's when I got this error:
File "C:\Anaconda3\Lib\site-packages\PyQt4\uic\pyuic.py", line 26, in module
from PyQt4 import QtCore
mportError: No module named 'PyQt4'
I should also probably mention that all the modules I have are through Anaconda 3
I thought installing pyqt in a conda... project? Would fix the problem. It didn't. To be honest I don't entirely know what those are for.
Now I'm entertaining the idea of just using the c++ files that QT designer makes instead of converting them and importing python to tell the gui what to do.
What do you guys think would solve the errors above?
Short solution / workaround:
In your python file import the missing module explicitly. In your case: import encodings.
Proper solution:
By importing every module separately so you might end up imorting many modules and submodules. In this case you need tell pyinstaller where to find the modules (e. g. using compile flags).
I'm trying to get PyQt5 working with WinPython. PyQt5 comes with a readme file for installation, and I have unsuccessfully tried a few combinations of what I thought the first part of the readme tells me to do.
I have:
Windows 7 Home Premium 64-bit
WinPython-64bit-2.7.9.1
Qt 5.4
PyQt-gpl-5.4
PyQt-gpl-5.4 is in the folder (only partially sure that this is where I should have put it)
C:\WinPython-64bit-2.7.9.1\python-2.7.9.amd64\Lib\site-packages\PyQt-gpl-5.4
My current attempt at getting everything working is: I'm trying to run the configure.py file in PyQt-gpl-5.4, but when I do so I consistently get the following error:
Error: PyQt5 requires Qt v5.0 or later. You seem to be using v4.8.6.
Make sure the correct version of qmake is on your PATH.
What I think is the required version of qmake being referred to is in the folder
C:\Qt\5.4\mingw491_32\bin
However, I have no idea how to fix the error by adding the qmake in this folder to PATH. My most recent attempt was to add the folder using Spyder's Tools->PYTHONPATH manager, but this made no difference. I also tried adding it using sys.path.append('C:\Qt\5.4\mingw491_32\bin'), but this didn't work either. I have since removed the folder name from both of these locations.
How do I get PyQt5 working with WinPython-64bit-2.7.9.1, or I think equivalently, how to I get the configure.py file in the PyQt-gpl-5.4 folder to run?
Thanks.
You definitely don't want the source code (i.e. PyQt-gpl-5.4) in the site-packages folder, because that's where the compiled modules will end up. Instead, it should just go in a temporary folder whilst you compile it.
When you run configure.py, you must take care to use the executable for the specific python that you are targeting. I do not know anything about WinPython, but for a normal python installation this means doing something like this:
C:\Python34\python configure.py
As a first step, before attempting to actually compile anything, it would be advisable to take at look at all the configuration options that are available, like this:
C:\Python34\python configure.py --help
(There's also the Installing PyQt5 section in the PyQt Docs).
This will tell you, for instance, that the simplest way to specify the Qt installation you are targeting would be something like this:
C:\Python34\python configure.py --qmake C:\Qt\5.4\mingw491_32\bin\qmake
EDIT:
Sorry, that last part is wrong: the --qmake option isn't available on Windows, so you have to add the directory containing the qmake executable to your PATH. This can be done with the following command:
set PATH=%PATH%;C:\Qt\5.4\mingw491_32\bin
Though splinter is installed on my Windows Vista, spyder gives an error when I import it.
When I import in windows command prompt, it successfully imports & also shows path to the init file.
Have added explicit path in PYTHONPATH Manager of Spyder and Updated module list. Yet, did not help.
Have checked my PATH environment variable. It contains the path to Python, Python/Scripts & Python/Lib/site-packages. PATH contains no spaces and PATH is indeed named as PATH & not as Path (probably thats why able to import successfully via command prompt)
When I try to install splinter again (just to confirm if it exists or not), pip says it already exists. When I try to upgrade, pip says it is already up-to-date
Have read lots & lots of articles on stackoverflow & across the web, but no solution helped.
Spyder recognizes other packages like os, numpy, etc.
Had run this code successfully on a temporary testing machine. Now trying to run on my system and its failing with error ImportError: No module named 'splinter'
Python ver. 3.4; Spyder ver. 3.4
Hoping for a solution...
Complete trackeback:
runfile('E:/Rampy/DS/Python/Code/AGMARK.py', wdir='E:/Rampy/DS/Python/Code')
Traceback (most recent call last):
File "", line 1, in
runfile('E:/Rampy/DS/Python/Code/AGMARK.py', wdir='E:/Rampy/DS/Python/Code')
File "C:\Users\ramprasad.g\AppData\Local\Continuum\Anaconda3\lib\site->packages\spyderlib\widgets\externalshell\sitecustomize.py", line 580, in runfile
execfile(filename, namespace)
File "C:\Users\ramprasad.g\AppData\Local\Continuum\Anaconda3\lib\site->packages\spyderlib\widgets\externalshell\sitecustomize.py", line 48, in execfile
exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace)
File "E:/Rampy/DS/Python/Code/AGMARK.py", line 8, in
from splinter import Browser
ImportError: No module named 'splinter'
Okay. So, I could make it work with a work-around.
Inspite of adding C:\Python34 & its Lib (site-packages) folder to PATH environment variable and Spyder's Python Path Manager, it failed to recognize splinter package while running the code in Spyder. So, I copied & pasted Splinter (followed by Selenium) package-folders from C:\Python34\Lib\site-packages (location where PIP installed the packages) to C:\Users\ramprasad.g\AppData\Local\Continuum\Anaconda3\Lib\site-packages (Anaconda's package location which alone Spyder seems to recognize) and boom! It started working!