Error installing pyflycapture2 on Windows - python

I am attempting to install this https://github.com/jordens/pyflycapture2 python binding on my Windows machine. The readme only has instructions on how to do it for Linux systems, but I imagine the library should still work.
I am able to run "python setup.py install" and it seems to successfully complete, but when I try to run "python test_flycapture2.py" I get this error:
C:\Users\clinic\Desktop\pyflycapture2>python test_flycapture2.py Traceback (most recent call last):
File "test_flycapture2.py", line 20, in <module>
import flycapture2 as fc2
File "build\bdist.win-amd64\egg\flycapture2.py", line 7, in <module>
File "build\bdist.win-amd64\egg\flycapture2.py", line 6, in __bootstrap__
ImportError: DLL load failed: The specified module could not be found.
This seems to imply that flycapture2 wasn't installed correctly. When I instead just open a python session and do "import flycapture2" I get the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build\bdist.win-amd64\egg\flycapture2.py", line 7, in <module>
File "build\bdist.win-amd64\egg\flycapture2.py", line 6, in __bootstrap__
ImportError: DLL load failed: The specified module could not be found.
Have I done something wrong with the installation process or does pyflycapture2 just not work with Windows?

A dumb solution that's worth a try. There are chances that the DLL are searched directly from where you're starting the python script. So if you have the dll somewhere on your computer, copy it along where you have your test_flycapture2.py.
But given the fact that the setup.py file has a whole bunch of absolute paths in there, I would not place my hopes too high. You can also try to install FlyCapture 2 at the exact same path, run python setup.py bdist_wheel (you will need to install wheel first with pip) in the pyflycapture2 folder, and see if that succeeds.
If it does, try installing the generated wheel (that will be in dist/ subfolder) by doing pip install dist/pyfly....wheel and test again.
Hope this helps

I'm answering this mostly because I found another post where the same question had been posted but the original problem was never answered.
How do I run an installed Python module on Windows?
In the comments, the original poster says that it suddenly started working. I found that the solution was simply to restart my computer. I have now attempted this on two computers and this worked for both of them.

Related

Installation of packages Pycharm 64-bit fails

I was previously on the path on working towards being able to obtain SEC 10K filings from Edgar, wherein I used a bloggers code for inspiration. When running this code in Pycharm 32-bit, I kept getting a "MemoryError" - which as far as I know is related to not having enough RAM (since 32-bit can only use 4GB).. I have 8GB of DDR3, so I figured if I installed Pycharm 64-bit, I should be ok!
However, when trying to set up the 64-bit version, and installing the same packages that I used previously in order to run the code again, I get the following error:
Collecting python-edgar
Using cached https://files.pythonhosted.org/packages/d0/5d/88b7c392cf9d69c61b418f9f5851292b52964fcde8f3116b2256e2fde5fa/python-edgar-2.3.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\PPB92\AppData\Local\Temp\pip-install-82zmyasf\python-edgar\setup.py", line 13, in <module>
long_description=read('README.md'),
File "C:\Users\PPB92\AppData\Local\Temp\pip-install-82zmyasf\python-edgar\setup.py", line 6, in read
return open(os.path.join(os.path.dirname(__file__), fname)).read()
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\PPB92\\AppData\\Local\\Temp\\pip-install-82zmyasf\\python-edgar\\README.md'
Does anyone know what I can do? I have very limited experience in programming, since I am a graduate student in finance and accounting..
It looks like there is problem in library itself, i have raised the issue on git.
For now you can do:
git clone git#github.com:edouardswiac/python-edgar.git
in your site-packages and under python-edgar folder run :
python setup.py install

Python missing DLL from installed module

I got a project which consists of Python and C++. I don't understand all of it but in order to compile and run everything I run an included BAT file. I have already installed the dependencies needed. Now when I run the script, I get this:
MainProcess - [INFO] os_utils: Disabling idle sleep not supported on this OS version.
world - [ERROR] launchables.world: Process Capture crashed with trace:
Traceback (most recent call last):
File "C:\work\pupil\pupil_src\launchables\world.py", line 118, in world
from plugin_manager import Plugin_Manager
File "C:\work\pupil\pupil_src\shared_modules\plugin_manager.py", line 15, in <module>
from video_capture import Base_Manager, Base_Source
File "C:\work\pupil\pupil_src\shared_modules\video_capture\__init__.py", line 36, in <module>
from .file_backend import FileCaptureError, FileSeekError
File "C:\work\pupil\pupil_src\shared_modules\video_capture\file_backend.py", line 13, in <module>
import av
File "C:\Users\XXX\AppData\Local\Programs\Python\Python36\lib\site-packages\av\__init__.py", line 9, in <module>
from av._core import time_base, pyav_version as __version__
ImportError: DLL load failed: The specified module could not be found.
It couldn't find pyav? But if I run:
C:\Users\XXX\Downloads>pip install av-0.3.1-cp36-cp36m-win_amd64.whl
Requirement already satisfied: av==0.3.1 from file:///C:/Users/XXX/Downloads/av-0.3.1-cp36-cp36m-win_amd64.whl in c:\users\anton\appdata\local\programs\python\python36\lib\site-packages
I already have it installed. What am doing wrong here?
If I open ...site-packages\av__init__.py" I can see this:
from av._core import time_base, pyav_version as __version__
is it something here?
I suspect that the module has successfully installed, but is dynamically linked against FFMPEG. You can obtain built distributions of FFMPEG from their website (https://www.ffmpeg.org/download.html). They provide both statically linked and dynamically linked builds, though it is going to be the dynamically linked one that is providing the dll's you need. Looking at my own copy of PyAV, it seems that the current release version (3.4.2) is the one that it is linked against.
When you download it, it will have a name like ffmpeg-date-build-win64-shared. In the bin directory, you will find all the relevant DLLs. You can either add this directory to the PATH, or more easily, copy the DLLs to your python location.

How to alter setup.py for CyIPOPT

I want to install the python package CyIpopt (https://github.com/matthias-k/cyipopt) on windows 10 and python version 3.5.2. For the binary I am using http://www.coin-or.org/Binaries/Ipopt/Ipopt-3.10.1-Win32-Win64-dll.7z (which I unpacked). The github page gives install instructions. At one point it says:
Download the source files of cyipopt and update setup.py to point to the header files and binaries of the Ipopt package, if LD_LIBRARY_PATH and pkg_config are not setup to find ipopt on their own.
I downloaded the source files from github and edited the setup.py file by altering lines 33-36 to :
IPOPT_ICLUDE_DIRS=['D:\...\Ipopt-3.10.1-Win32-Win64-dll\include\coin', np.get_include()]
IPOPT_LIBS=['IpOptFSS','IpOpt-vc10','IpOpt-vc8']
IPOPT_LIB_DIRS=['D:\...\Ipopt-3.10.1-Win32-Win64-dll\lib\\x64\Release MKL']
IPOPT_DLL=['IpOptFSS.dll','IpOpt-vc10.dll','IpOpt-vc8.dll']
The dots represent the path to these folders on my computer. Now when I run python setup.py install, it run succesfuly. However when I then run python and import ipopt I get the following error:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Linthorst\Miniconda3\lib\site-packages\ipopt-0.1.6-py3.5-win-amd64.egg\ipopt__init__.py", line 40, in
from cyipopt import *
ImportError: No module named 'cyipopt'
I suspect I altered the setup.py file incorrectly (since I made an educated guess). I am confused that it installed but doesn't work. Can anybody help me solve this error? Many thanks in advance

python - pyinstaller "RuntimeWarning: Parent module 'PyInstaller.hooks.hook-PIL' not found while handling absolute import" and "tcl" related errors

I get a warning message while trying to create exectable file using pyinstaller. This warning appeared after installing Pillow. Previously i nevre got any warnings and was able to make it through.
the warning i get by pyinstaller is:
7314 INFO: Analyzing main.py
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyInstaller-2.1.1dev_-py2.7.egg/PyInstaller/hooks/hook-PIL.Image.py:14: RuntimeWarning: Parent module 'PyInstaller.hooks.hook-PIL' not found while handling absolute import
from PyInstaller.hooks.shared_PIL_Image import *
Also when i tried to run the executable's exe/consol version of my code that lies inside the dist folder created by the pyinstaller (dist/main/main), these are displayed..
Traceback (most recent call last):
File "<string>", line 26, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyInstaller-2.1.1dev_-py2.7.egg/PyInstaller/loader/pyi_importers.py", line 276, in load_module
exec(bytecode, module.__dict__)
File "/Users/..../build/main/out00-PYZ.pyz/PIL.PngImagePlugin", line 40, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyInstaller-2.1.1dev_-py2.7.egg/PyInstaller/loader/pyi_importers.py", line 276, in load_module
exec(bytecode, module.__dict__)
File "/Users/..../build/main/out00-PYZ.pyz/PIL.Image", line 53, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyInstaller-2.1.1dev_-py2.7.egg/PyInstaller/loader/pyi_importers.py", line 276, in load_module
exec(bytecode, module.__dict__)
File "/Users/..../build/main/out00-PYZ.pyz/FixTk", line 74, in <module>
OSError: [Errno 20] Not a directory: '/Users/.../dist/main/tcl'
logout
[Process completed]
so, i tried by uninstalling pillow, installing tk tcl dev version. And then installed pillow. Even that didnt helped.
I also tried reinstalling pyinstaller,. didnt help too
Update 1:
It seems Pyinstaller.hooks.hook-PIL.py file was missing in the Pyinstaller/hooks directory. And it was missing on all platforms(Mac, windows and linux). This is the warning/error message that i get on windows, which is the same i got on mac and on linux.
Later i found a link which said, its just to need Python import machinery happy. so i created as said so. Then i dont get the same error on all platforms, But on mac i still get the PILImagePlugin,Image and FixTk errors
Solution for tcl:
I found what was going wrong,.. Every problem that i faced on OSX was the OS itself(exactly the macport). Python by default comes with the mac OS. And this version of python may be useful for just learning basic python, but is not suitable for Development purpose.
Installing brew's python helped. I followed this SO link. After doing these i was still getting errors. Later i had to change the paths on /etc/paths. Basically rearranging them should work. But still then i wasn't getting it right.
Then i had to change the .bash_profile, which worked for most users, But still i was getting mac's version of python and pip, not the brews version of python.
Finally i had to restart the machine for a couple of times and do the /etc/paths and .bash_profile steps repeatedly to get the system wide effect to accept brews version of python and pip
Solution for PIL:
just adding a file called hook-PIL.py with an empty content would serve the purpose. I found a link which was having the hook files content of pyinstaller.
The location to create
for mac : /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyInstaller-2.1.1dev_-py2.7.egg/PyInstaller/hooks/ Actually for mac this step wouldn’t be required. When we install python through brew and change the path, everything that you try to install later either through pip install or from source packages tend to choose a different path. And everything will be taken care of.
for windows:C:\Python27\lib\site-packages\PyInstaller-2.1.1.dev0-py2.7.egg\PyInstaller\hooks
**Please check if this is a valid path on your machine before creating the file and then create the file. And im not sure or i don't know if just adding an empty file is the right way. But it worked for me

Difficulties installing SOAPpy module

I am very new to python and have been figuring out how to install modules.I have been trying to install the SOAPpy module and have only had success with the required modules fpconst, wstools, and setuptools(not mentioned as required, but still ended up being required).
I am getting an error when I try and install the SOAPpy module.
Traceback <most recent call last>:
File "...\setup.py", line 43, in module <module>
__version__ = load_version()
File "...\setup.py", line 35 in load_version
execfile(filename, d.__dict__)
IOError: [Errno 2] Unable to load the version number (no such file or directory):
'...\\src\\SOAPpy\\version.py'
Not sure what i should do to fix this.
Any help is greatly appreciated!
Looking at SOAPpy's setup.py file, it tries to import SOAPpy.version. This doesn't work if you're calling it from somewhere else. Try running it directly in the SOAPpy directory because Python adds your current working directory to sys.path. For example:
cd C:\Users\eclaird\Download\SOAPpy\ # The folder with setup.py
python.exe setup.py install
Thanks for the help.
I eventually found what the issue was. I had to get some other required modules for the install to work, also the tar file I got was missing directories, so I found the completed version on Github.

Categories

Resources