Closed gfleetwood closed 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?
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'
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.
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.
This still looks like something's off with the python path. Just to be sure of the steps, your doing:
git clone
mkvirtualenv sample-env --python python3
- or your favorite way of managing virtualenvscd sofi
python setup.py install
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.
Can sofi apps be deployed on the web - using Heroku, for instance? If not, could it theorectically be integrated with something like Flask?
What resources would you recommend for someone looking to understand how sofi was built?
The README gives a quick and dirty. Adding a few more items:
sofi.app.Sofi
class is what you need to start the server.Sofi.__init__
has some relevant parameters for setting up listening address and port, as well as the singleclient
param that you'll need to set to False if you're planning some web stuff.Sofi.start()
actually starts the server, and you'll need autobrowse
set to False if you don't want it to automatically open a browser when it runs (which is the case for a web app).sofi.app.ui
, you'll have to look through those to see what's available at the moment. We're still missing several key items.Sofi.handlers
gives you an idea of the default event handlers I've configured.Sofi.register()
methods to setup callback functions to the different events you need.init
event. This is the initial event you want to listen for in order to setup your main content.load
, append
, remove
, replace
, addclass
, removeclass
, text
, attr
, style
, property
. Each of these has docstrings with a short description of what they do.sofi.ui.*
widgets are intended to help build content, mostly based on Bootstrap. The __str__
methods on those objects will spit out the HTML that represents whatever properties you've configured with them.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.
Hi,
I'm on a 64 bit Ubuntu 16.04 machine and followed more or less the following steps to install sofi:
Created a conda virtual environment containing Python 3.5.
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:Any idea what could be wrong?