Installation of packages Pycharm 64-bit fails - python

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

Related

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

Error installing pyflycapture2 on Windows

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.

Python GUI2Exe Application Standalone Build (Using Py2Exe)

I am trying to build a Python Script into a stand alone application. I am using GUI2Exe. My script uses selenium package. I have it installed.
Project compiles fine and runs on python command line directly but fails to build a stand alone because it is referring to folder:
ERROR: test_file_data_extract (__main__.FileDataExtract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "File_data_extract.py", line 18, in setUp
File "selenium\webdriver\firefox\firefox_profile.pyc", line 63, in __init__
IOError: [Errno 2] No such file or directory: 'C:\\users\\username\\PycharmProjects\\Python_27_32bit\\file_data_extract\\dist\\File_data_extract.exe\\selenium\\webdriver\\firefox\\webdriver_prefs.json'
It is looking for selenium package is located at :
C:\Users\username\Anaconda2_Py27_32bit\Lib\site-packages\selenium-2.48.0-py2.7.egg\selenium\webdriver\firefox
where C:\Users\username\Anaconda2_Py27_32bit is where I installed Anaconda Python 2.7, 32 bit version. By default it is looking for in \dist\filename.exe folder.
I was able to build it using bbfreeze. It works great.
First I had to install bbfreezee via pip (one time only):
pip install bbfreeze
Create a build_package.py file as:
from bbfreeze import Freezer
f = Freezer("project_name", includes=("selenium","SendKeys",)) #list problem packages here to manually include
f.addScript("project_name_script.py")
f() # starts the freezing process
Build project:
python build_package.py bdist_bbfreezee
in folder project_name where project_name_script.py sits you find project_name_script.exe with all the include packages including selenium and sendkeys. When you distribute the package you need to distribute entire project_name because it contains all dependent library dlls (python .pyd).
More details refer official bbfreezee here:
https://pypi.python.org/pypi/bbfreeze/#downloads

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

Chirp Running on Maemo

I'm trying to get Chirp to run under Maemo5 (a debian based mobile operating system).
When running .chirpw or setup.py I get this as a result
Nokia-N900:~/compile/chirp-0.3.1# ./chirpw
CHIRP 0.3.1 on Linux - Maemo 5 %h (Python 2.5.4)
Traceback (most recent call last):
File "./chirpw", line 105, in <module>
from chirp import *
File "/root/compile/chirp-0.3.1/chirp/icq7.py", line 50
class ICQ7Radio(icf.IcomCloneModeRadio):
^
SyntaxError: invalid syntax
I am using the chirp source found here: http://chirp.danplanet.com/download/0.3.1/chirp-0.3.1.tar.gz
The idea is to be able to program my radios from my linux powered phone, however I can't seem to figure out why the program is getting held up on the ICQ7Radio class.
Any help/pointers would be much appreciated.
That version is quite old, have a try with latest daily build http://trac.chirp.danplanet.com/chirp_daily/LATEST/
You can also download full hg repository with
hg clone http://d-rats.com/hg/chirp.hg
See also http://chirp.danplanet.com/projects/chirp/wiki/Developers

Categories

Resources