tryexceptpass / sofi

an OS agnostic UI module for Python
MIT License
387 stars 49 forks source link

Problem Installing In Virtual Environment #87

Closed gfleetwood closed 7 years ago

gfleetwood commented 7 years ago

Hi,

I'm on a 64 bit Ubuntu 16.04 machine and followed more or less the following steps to install sofi:

  1. Created a conda virtual environment containing Python 3.5.

  2. Downloaded the zip of sofi and ran python setup install in the extracted folder.

I then created a file with the code example from the README and tried to run it from the command line with python sofi.py. This is what I got as the output:

Traceback (most recent call last):
  File "sofi.py", line 1, in <module>
    from sofi.app import Sofi
  File "/home/gordon/Downloads/sofi.py", line 1, in <module>
    from sofi.app import Sofi
ImportError: No module named 'sofi.app'; 'sofi' is not a package

Any idea what could be wrong?

tryexceptpass commented 7 years ago

I haven't tried with a conda virtual env, but I see there are some issues with setup.py ... Do you have any trouble if you work from the sofi directory and pip install -r requirements.txt in the meantime?

gfleetwood commented 7 years ago

I tried install the requirements outside of a virtual environment and this is the traceback:

Traceback (most recent call last):
  File "/home/gordon/anaconda3/bin/pip", line 11, in <module>
    sys.exit(main())
  File "/home/gordon/anaconda3/lib/python3.5/site-packages/pip/__init__.py", line 233, in main
    return command.main(cmd_args)
  File "/home/gordon/anaconda3/lib/python3.5/site-packages/pip/basecommand.py", line 252, in main
    pip_version_check(session)
  File "/home/gordon/anaconda3/lib/python3.5/site-packages/pip/utils/outdated.py", line 102, in pip_version_check
    installed_version = get_installed_version("pip")
  File "/home/gordon/anaconda3/lib/python3.5/site-packages/pip/utils/__init__.py", line 838, in get_installed_version
    working_set = pkg_resources.WorkingSet()
  File "/home/gordon/anaconda3/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 644, in __init__
    self.add_entry(entry)
  File "/home/gordon/anaconda3/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 700, in add_entry
    for dist in find_distributions(entry, True):
  File "/home/gordon/anaconda3/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1949, in find_eggs_in_zip
    if metadata.has_metadata('PKG-INFO'):
  File "/home/gordon/anaconda3/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1463, in has_metadata
    return self.egg_info and self._has(self._fn(self.egg_info, name))
  File "/home/gordon/anaconda3/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1823, in _has
    return zip_path in self.zipinfo or zip_path in self._index()
  File "/home/gordon/anaconda3/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1703, in zipinfo
    return self._zip_manifests.load(self.loader.archive)
  File "/home/gordon/anaconda3/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1643, in load
    mtime = os.stat(path).st_mtime
FileNotFoundError: [Errno 2] No such file or directory: '/home/gordon/anaconda3/lib/python3.5/site-packages/txaio-2.6.2-py3.5.egg'
tryexceptpass commented 7 years ago

This looks like something's off with the python path. It's essentially saying it can't find the egg file for a module it just downloaded.

gfleetwood commented 7 years ago

Managed to get rid of that error but now I get this:

Traceback (most recent call last):
  File "sofi.py", line 1, in <module>
    from sofi.app import Sofi
  File "/home/gordon/Downloads/sofi.py", line 1, in <module>
    from sofi.app import Sofi
ImportError: No module named 'sofi.app'; 'sofi' is not a package

I also tried installing it on a Windows machine and I got the same thing.

tryexceptpass commented 7 years ago

This still looks like something's off with the python path. Just to be sure of the steps, your doing:

gfleetwood commented 7 years ago

So that works. The only difference from my previous attempts was cloning the repo instead of downloading the zipped version. Not sure if that's strange or just something to know. Thanks!

I actually have two questions.

  1. Can sofi apps be deployed on the web - using Heroku, for instance? If not, could it theorectically be integrated with something like Flask?

  2. What resources would you recommend for someone looking to understand how sofi was built?

tryexceptpass commented 7 years ago
  1. Yes, you can deploy on the web. You still need a server like NGINX that can serve the main.html and sofi.js files. I haven't worked out all the details yet of a proper deployment, but I've verified I can have multiple clients, though I don't know how many in parallel.
  2. I've got an issue open to build documentation. I plan to put it up on read the docs. Unfortunately I haven't had much time to work on it lately. I'd be happy to answer any questions you might have through this issue in the meantime.

The README gives a quick and dirty. Adding a few more items:

gfleetwood commented 7 years ago

Thanks for the detailed reply! Looking forward to see how the project progresses, and I'll try to contribute if I can.

I'll close this now.