mozilla-services / syncserver

Run-Your-Own Firefox Sync Server
Mozilla Public License 2.0
1.87k stars 145 forks source link

build error: /usr/bin/python2: No module named virtualenv #289

Open lalo311 opened 2 years ago

lalo311 commented 2 years ago

I am trying to build syncserver with the make build command, on my RPi 3 with DietPi, and the make build command returns this :

# Install the latest Python 2 compatible setuptools manually:
# https://github.com/mozilla-services/syncserver/issues/239
`which python2 python2.7 python | head -n 1` -m virtualenv --python=`which python2 python2.7 python | head -n 1` ./local --no-setuptools
/usr/bin/python2: No module named virtualenv
make: *** [Makefile:29: local/COMPLETE] Error 1

I'm a beginner with linux and raspberry pi so sorry if I'm acting dumb, also I already tried reinstalling virtualenv with the pip and pip3 install virtualenv command. And when I use the command on the docs website : sudo apt-get install python-dev git-core python-virtualenv g++, I get this :

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'python-dev-is-python2' instead of 'python-dev'
Note, selecting 'git' instead of 'git-core'
Package python-virtualenv is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python-virtualenv' has no installation candidate

Thanks in advance !

jrconlin commented 2 years ago

A few possible things:

1) Python2 is no longer supported by a lot of platforms, so quite a number of them dropped the python-virtualenv package from their installs. You might have to do a search using something like apt search virtualenv and see what shows up. (It may be virtualenv, python-virtualenv, python2-virtualenv or any number of variants)

2) Because python2 is no longer supported, you may hit other problems trying to install. You might want to consider running syncstorage in a Docker shell like python:2.7-buster (Docker doesn't eat that much more CPU or Memory, but it can eat disk space, so you might want to run docker image prune after to remove unused installation images.

prg318 commented 1 year ago

If your OS doesn't bundle python-pip/python-virtualenv, you can install pip manually and then install virtualenv with pip:

wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
python2 get-pip.py
export PATH=$HOME/.local/bin:$PATH
pip2 install virtualenv