Open jetzerb opened 4 years ago
Sorry for the slow reply on this. I believe the documention instructions have expanded a bit since you first reported this. Hopefully we can continue to expand this over time.
@jetzerb On my 19.10 I just did:
pip3 install migra
@jgrocha Then you must have had all the pre-requisites installed already. Here's a demonstration when starting from a base Ubuntu image:
docker run --rm -it ubuntu:19.10
Unable to find image 'ubuntu:19.10' locally
19.10: Pulling from library/ubuntu
3f2411103a12: Pull complete
4da04088b2c2: Pull complete
ab1184837b6f: Pull complete
354c6da61dcc: Pull complete
Digest: sha256:f332c4057e21ec71cc8b20b05328d476104a069bfa6882877e0920e8140edcf0
Status: Downloaded newer image for ubuntu:19.10
### First attempt:
root@6e9176fc9fd7:/# pip3 install migra
bash: pip3: command not found
### need to install pip3:
root@6e9176fc9fd7:/# apt-get update && apt-get install --no-install-recommends python3-pip
. . . snip . . .
### Second attempt:
root@6e9176fc9fd7:/# pip3 install migra
Collecting migra
Downloading https://files.pythonhosted.org/packages/2c/e5/24ec37176d85128ebac2fdb7a97748fb65e1f3435ae1cded022d4e94dd35/migra-1.0.1593567183-py2.py3-none-any.whl
Collecting sqlbag (from migra)
Downloading https://files.pythonhosted.org/packages/ec/ad/ac257da1c9c63c0a2bb44c77b5fe7a146eea7b1c2be2b251cb0c2c1f8e0c/sqlbag-0.1.1579049654-py2.py3-none-any.whl
Collecting schemainspect>=0.1.1593565676 (from migra)
Downloading https://files.pythonhosted.org/packages/52/8d/2bebbb9f4b12694c79cbe0b8471ffc3208726074cb1639e3617fc07d8c7b/schemainspect-0.1.1593605722-py2.py3-none-any.whl
Collecting six (from migra)
Downloading https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
Collecting pathlib (from sqlbag->migra)
Downloading https://files.pythonhosted.org/packages/ac/aa/9b065a76b9af472437a0059f77e8f962fe350438b927cb80184c32f075eb/pathlib-1.0.1.tar.gz (49kB)
100% |ββββββββββββββββββββββββββββββββ| 51kB 3.8MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'setuptools'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-7_0_frbb/pathlib/
I could continue, but as per the original post, certain packages are required in order for the migra installation to succeed.
More recently, this is what it took for things to work for me:
apt-get update;
apt-get install --no-install-recommends python3 python3-setuptools python3-wheel python3-pip;
apt-get install libpq-dev python3-dev
pip3 install migra[pg];
Had some trouble installing
migra
on Ubuntu 19.10 per the official instructions.TL;DR
On Ubuntu, the following script ensures that all pre-requisites are present, and then installs
migra
:Gory Details:
Initial attempt at installing via
pip install migra[pg]
failed with the following error:Searching through the issues list, I found #46 which says to be sure to use the Python3 version of
pip
. I removed thepython-pip
package and installedpython3-pip
, then triedmigra
again viapip3 install migra[pg]
and got the same error as above πI did see that Ubuntu has a package
python3-sqlalchemy
, so I installed that and triedmigra
again. This time, I got the same "No module named setuptools" error while thepathlib
dependency was being installed:I found that there is a
python3-setuptools
package, so I installed that, and then triedmigra
again. But then I got a new error, although it appears thatmigra
was installed:And I confirmed it was indeed successfully installed by pointing
migra
at two databases and getting the correct upgrade script. However, the "bdist_wheel" error bothered me, so I looked further and saw that there is a Ubuntu packagepython3-wheel
. Once that is installed, themigra
installation is successful and error-free.