MikePia / structjour

A tool to automate the daily review of trades
GNU General Public License v3.0
41 stars 9 forks source link

Module not Found PyQt5.sip #3

Closed MikePia closed 5 years ago

MikePia commented 5 years ago

Error happens when running structjour.exe after a setup.py install is used to install the modules pyqt5, pyqt5-sip pyqtwebengine

MikePia commented 5 years ago

uploaded to pypi. Install should work with pip install structjour

If the Module not found PyQt5.sip is a problem. Reinstall the pyqt stuff with these two commands

pip uninstall -y pyqt5 pyqt5-sip pyqtwebengine pip install structjour

luigima commented 5 years ago

It indeed works now, or, at least this error is gone. However, I noticed the followings:

...
  File "...\python37\lib\site-packages\pkg_resources\__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "...\python37\lib\site-packages\structjour\view\runtrade.py", line 32, in <module>
    from structjour.definetrades import DefineTrades
  File "...\python37\lib\site-packages\structjour\definetrades.py", line 29, in <module>
    from structjour.statements.ibstatementdb import StatementDB
  File "...\python37\lib\site-packages\structjour\statements\ibstatementdb.py", line 36, in <module>
    from structjour.thetradeobject import SumReqFields
  File "...\python37\lib\site-packages\structjour\thetradeobject.py", line 36, in <module>
    from structjour.stock.graphstuff import FinPlot
  File "...\python37\lib\site-packages\structjour\stock\graphstuff.py", line 41, in <module>
    from structjour.stock import myalphavantage as mav
  File "...\python37\lib\site-packages\structjour\stock\myalphavantage.py", line 84, in <module>
    APIKEY = getPickledKey('alphavantage')['key']
  File "...\python37\lib\site-packages\structjour\stock\picklekey.py", line 48, in getKey
    with open(PFILE, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\\\python\\E\\stock\\keys.pickle'

The absolute file path seems to be hardcoded which you might want to change.

MikePia commented 5 years ago

Thank you so much. Added requests to dependencies. The picklekey errors should all be gone. Uploaded to PyPI structjour v 0.9.91a13

I don't know how to address the TkInter requirement. What is it that requires TkInter? Did you have to install tk or anything?

luigima commented 5 years ago

Yeah I had to install TkInter, I cannot explain why tho.

The errors are gone, here is the next one:

 File "...\python37\lib\site-packages\structjour-0.9.91a13-py3.7.egg\structjour\stock\mybarchart.py", line 94, in <module>
    DEMO_PARAMS = {'apikey': getApiKey(),
  File "...\python37\lib\site-packages\structjour-0.9.91a13-py3.7.egg\structjour\stock\mybarchart.py", line 41, in getApiKey
    mk = ManageKeys()
  File "...\python37\lib\site-packages\structjour-0.9.91a13-py3.7.egg\structjour\stock\utilities.py", line 254, in __init__
    self.setDB()
  File "...\python37\lib\site-packages\structjour-0.9.91a13-py3.7.egg\structjour\stock\utilities.py", line 269, in setDB
    if not os.path.exists(self.db):
  File "...\Python37\lib\genericpath.py", line 19, in exists
    os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
MikePia commented 5 years ago

Fixed and uploaded to pypi v 0.9.91a14

luigima commented 5 years ago

Add "Pillow" to the requirements and the app will open without any errors :)

MikePia commented 5 years ago

Yea the low bar has been set.

MikePia commented 5 years ago

Pillow added (WorldTradeData api added, IEX api removed entirely) Uploaded to PyPi v 0.9.91a18