Closed fStiedemann closed 6 years ago
There are no instructions for debian/ubuntu installations.
Yeah, this could be improved.
./setup.py: line 3: syntax error near unexpected token newline' ./setup.py: line 3:setuptools.setup('
This is because setup.py contains no interpreter directive, so it's being executed by your shell instead of by python. Because you're already using pip anyway, I instead suggest:
pip3 install .
How exactly do I install pb in ubuntu 16?
After installed, if you want to use uwsgi, use a config like this:
[uwsgi]
http-socket = [::]:8080
module = pb.__main__:app
plugins = python3
hello i did pip3 install .
and everything installed successfully. mongodb is listening, how do i start pb now? can you recommend a systemd pb.service conf?
how do i start pb now?
In my opinion, docker is the best way to do pretty much everything. The docker-compose file that pb ships with works great.
can you recommend a systemd pb.service conf?
Unrelated to what I just said, this pb.service still looks pretty valid provided you have uwsgi install on a distribution like archlinux that ships a uwsgi@.service
, and have a pb.ini
in the correct place.
Another alternative is to just run:
python -m pb
$ uname -a
Linux server 4.9.0-4-amd64 #1 SMP Debian 4.9.51-1 (2017-09-28) x86_64 GNU/Linux
user@server:/var/www/pb$ python -m pb
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/var/www/pb/pb/__main__.py", line 17, in <module>
import sys, __main__
File "pb/__main__.py", line 31, in <module>
from pb import db
File "pb/pb.py", line 15, in <module>
from pb.cache import init_cache
ImportError: No module named cache
user@server:/var/www/pb$ python3 -m pb
Traceback (most recent call last):
File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/var/www/pb/pb/__main__.py", line 21, in <module>
p = path(p).resolve()
File "/usr/lib/python3.5/pathlib.py", line 1109, in resolve
s = self._flavour.resolve(self)
File "/usr/lib/python3.5/pathlib.py", line 330, in resolve
return _resolve(base, str(path)) or sep
File "/usr/lib/python3.5/pathlib.py", line 315, in _resolve
target = accessor.readlink(newpath)
File "/usr/lib/python3.5/pathlib.py", line 422, in readlink
return os.readlink(path)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/python35.zip'
user@server:/var/www/pb$
Any advice? How do I resolve ImportError: No module named cache
?
ImportError: No module named cache
This is because python2's import mechanism by default is relative, while some of pb
imports depend on python3-style absolute_import
. pb overall is not compatible with python2 in other ways as well. I guess it might be helpful to do version checking in setup.py; I just never imagined someone would try this.
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/python35.zip'
It looks like your python3.5 installation is incomplete. Maybe try making sure it is completely installed with:
apt-get install python3
Also if you're using anything older than debian stretch (jessie/wheezy), that version of python3 will be too old as well.
python3.5 has a separate site-packages, so you'll need to make sure you have a working pip3
and install pb into your python3.5 site-packages as well.
IMO, working with system python installations is a massive pain. You might also try this easy 3-step docker deployment method:
1) Install docker
https://docs.docker.com/engine/installation/linux/docker-ce/debian/#install-docker-ce
2) start mongo
docker run -d --name mongodb mongo
3) start pb (latest, auto-generated from master)
docker run -d --link mongodb --publish 10002:10002 ptpb/pb
Verify with curl http://localhost:10002
Thanks so much. The docker installation you linked to was helpful.
Hey,
There are no instructions for debian/ubuntu installations. I did this:
And get this error:
How exactly do I install pb in ubuntu 16?