aiven / aiven-db-migrate

Apache License 2.0
21 stars 10 forks source link

Venv installation failure #15

Open Datise opened 3 years ago

Datise commented 3 years ago

Hi I was attempting to install the tool using venv but ran into this:

➜  aiven-db-migrate git:(master) ✗ python3 -m venv venv
➜  aiven-db-migrate git:(master) ✗ . venv/bin/activate
(venv) ➜  aiven-db-migrate git:(master) ✗ pip install .
Processing /Users/djb/work/aiven-db-migrate
    ERROR: Command errored out with exit status 1:
     command: /Users/djb/work/aiven-db-migrate/venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/zm/4bd70yhx4m1drjwxpfd7pd_40000gn/T/pip-req-build-nv63xi38/setup.py'"'"'; __file__='"'"'/private/var/folders/zm/4bd70yhx4m1drjwxpfd7pd_40000gn/T/pip-req-build-nv63xi38/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/zm/4bd70yhx4m1drjwxpfd7pd_40000gn/T/pip-pip-egg-info-w48lrc8g
         cwd: /private/var/folders/zm/4bd70yhx4m1drjwxpfd7pd_40000gn/T/pip-req-build-nv63xi38/
    Complete output (16 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/zm/4bd70yhx4m1drjwxpfd7pd_40000gn/T/pip-req-build-nv63xi38/setup.py", line 31, in <module>
        version=get_version(),
      File "/private/var/folders/zm/4bd70yhx4m1drjwxpfd7pd_40000gn/T/pip-req-build-nv63xi38/setup.py", line 10, in get_version
        return SourceFileLoader("version", "aiven_db_migrate/migrate/version.py").load_module().__version__
      File "<frozen importlib._bootstrap_external>", line 462, in _check_name_wrapper
      File "<frozen importlib._bootstrap_external>", line 962, in load_module
      File "<frozen importlib._bootstrap_external>", line 787, in load_module
      File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
      File "<frozen importlib._bootstrap>", line 702, in _load
      File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 779, in exec_module
      File "<frozen importlib._bootstrap_external>", line 915, in get_code
      File "<frozen importlib._bootstrap_external>", line 972, in get_data
    FileNotFoundError: [Errno 2] No such file or directory: 'aiven_db_migrate/migrate/version.py'
    ----------------------------------------

Apologies if I'm missing something, I don't really have python experience.

ansrivas commented 3 years ago

@Datise Thanks for reporting this. Can you try to run the following commands?

$ python3 -m venv venv
$ . venv/bin/activate
$ ## Run make to automatically generate the version info from git-tag
$ make
$ pip install .

NOTE: In case the process fails at psycopg2 installation stage, please also run pip install psycopg2-binary==2.8.6

Datise commented 3 years ago

Thanks for the help @ansrivas . I have run into installing psycopg2 and the suggestion doesn't resolve it. I'll did into it when I have time next week.

kedare commented 2 years ago

The problem is still current.

setup.py tries to import aiven_db_migrate/migrate/version.pythat doesn't exist in the repository.

Make need to be run to generate it, maybe it would be interesting to add a warning when running setup.py with this file missing ?