Nukesor / archivebot

:floppy_disk: A telegram bot for backing up and collecting all kinds of media.
MIT License
100 stars 31 forks source link

Installation error #10

Closed LoJbaDelRoito closed 5 years ago

LoJbaDelRoito commented 5 years ago

Hi, I have a problem during the installation. I don't know how to solve this problem.

That's a copy of my terminal:

@DESKTOP:/mnt/c/Users/cened/Desktop/archivebot-master$ ./venv/bin/activate
@DESKTOP:/mnt/c/Users/cened/Desktop/archivebot-master$ ./initdb.py
Traceback (most recent call last):
  File "./initdb.py", line 4, in <module>
    from sqlalchemy_utils.functions import database_exists, create_database, drop_database
ImportError: No module named sqlalchemy_utils.functions
Nukesor commented 5 years ago

It looks like you didn't install all requirements. I just made a clean clone of the repository and set everything up according to the installation guide, but I couldn't reproduce your bug.

Could you provide more information on how to reproduce this behavior?

LoJbaDelRoito commented 5 years ago

I'm working on windows subsystem for Linux (WSL). Probably that's the problem... I also tried to change python version, without any result. I previously encountered problems while executing %make, which in particular didn't install the cryptg and thelethon packages. I solved the problem by looking at various forums, but i don't remember how. I will try to do a clean boot and i'll tell you more information. Thanks!

I apologize for my bad English...

LoJbaDelRoito commented 5 years ago

I can't execute git clone git@github.com:nukesor/archivebot && cd archivebot so i manually download the file. The only change i have done to the code is, change in the ./initdb.py file the #!/bin/env python with

#!/usr/bin/env python because it say bash: ./initdb.py: /bin/env: bad interpreter: No such file or directory after ./initdb.py

Than i execute the following command. I put here all the terminal response: m@DESKTOP-Q6G6L03:/mnt/c/Users/cened/Desktop/archivebot-master$ make python3 -m venv venv venv/bin/pip install --upgrade pip Cache entry deserialization failed, entry ignored Collecting pip Using cached https://files.pythonhosted.org/packages/5c/e0/be401c003291b56efc55aeba6a80ab790d3d4cece2778288d65323009420/pip-19.1.1-py2.py3-none-any.whl Installing collected packages: pip Found existing installation: pip 9.0.1 Uninstalling pip-9.0.1: Successfully uninstalled pip-9.0.1 Successfully installed pip-19.1.1 venv/bin/pip install -r requirements.txt --upgrade Collecting cryptg (from -r requirements.txt (line 1)) Using cached https://files.pythonhosted.org/packages/4f/21/9d242c1ed5dbf4a26bedf14355db62e2fed1dcc433099e79de5de4fa788c/cryptg-0.1.0.7.tar.gz Collecting telethon (from -r requirements.txt (line 2)) Using cached https://files.pythonhosted.org/packages/f2/4e/39f9abaf7b96a01196f1cd7380c1ea2e0b45e5c162b071fb1eac44414f43/Telethon-1.7.7-py3-none-any.whl Collecting SQLAlchemy~=1.2 (from -r requirements.txt (line 3)) Using cached https://files.pythonhosted.org/packages/2b/b2/e6f5c5efc68942edefaa924e8fbea0b32375baa434a511cbf6bb17769cf6/SQLAlchemy-1.3.3.tar.gz Collecting sqlalchemy-utils~=0.33 (from -r requirements.txt (line 4)) Using cached https://files.pythonhosted.org/packages/fe/8b/a68f81076e9a2729675253228f43986914f0510078c86f14f6cd51dd3f01/SQLAlchemy-Utils-0.33.11.tar.gz Collecting raven (from -r requirements.txt (line 7)) Using cached https://files.pythonhosted.org/packages/bd/8e/62e26a88c0a1bbae677200baf0767c1022321a6555634f8129e6d55c5ddc/raven-6.10.0-py2.py3-none-any.whl Collecting pyaes (from telethon->-r requirements.txt (line 2)) Using cached https://files.pythonhosted.org/packages/44/66/2c17bae31c906613795711fc78045c285048168919ace2220daa372c7d72/pyaes-1.6.1.tar.gz Collecting rsa (from telethon->-r requirements.txt (line 2)) Using cached https://files.pythonhosted.org/packages/02/e5/38518af393f7c214357079ce67a317307936896e961e35450b70fad2a9cf/rsa-4.0-py2.py3-none-any.whl Collecting six (from sqlalchemy-utils~=0.33->-r requirements.txt (line 4)) Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl Collecting pyasn1>=0.1.3 (from rsa->telethon->-r requirements.txt (line 2)) Using cached https://files.pythonhosted.org/packages/7b/7c/c9386b82a25115cccf1903441bba3cbadcfae7b678a20167347fa8ded34c/pyasn1-0.4.5-py2.py3-none-any.whl Installing collected packages: cryptg, pyaes, pyasn1, rsa, telethon, SQLAlchemy, six, sqlalchemy-utils, raven Running setup.py install for cryptg ... done Running setup.py install for pyaes ... done Running setup.py install for SQLAlchemy ... done Running setup.py install for sqlalchemy-utils ... done Successfully installed SQLAlchemy-1.3.3 cryptg-0.1.0.7 pyaes-1.6.1 pyasn1-0.4.5 raven-6.10.0 rsa-4.0 six-1.12.0 sqlalchemy-utils-0.33.11 telethon-1.7.7 venv/bin/pip install -r requirements-dev.txt --upgrade Collecting flake8 (from -r requirements-dev.txt (line 2)) Using cached https://files.pythonhosted.org/packages/e9/76/b915bd28976068a9843bf836b789794aa4a8eb13338b23581005cd9177c0/flake8-3.7.7-py2.py3-none-any.whl Collecting flake8-docstrings (from -r requirements-dev.txt (line 3)) Using cached https://files.pythonhosted.org/packages/4e/ab/927dada116644e776c2668175d35545786f8a5120a9bdbfaaba2aab71687/flake8_docstrings-1.3.0-py2.py3-none-any.whl Collecting flake8-print (from -r requirements-dev.txt (line 4)) Using cached https://files.pythonhosted.org/packages/f2/06/c6a4916f14e8ae526b27f921d953b1e64adecf63ab479322edba2d361263/flake8-print-3.1.0.tar.gz Collecting flake8-commas (from -r requirements-dev.txt (line 5)) Using cached https://files.pythonhosted.org/packages/ab/1f/b1a3b8068bc0d3254a0c2d34e0409c380eb3449cc5582725403b30ef1de8/flake8_commas-2.0.0-py2.py3-none-any.whl Collecting flake8-bugbear (from -r requirements-dev.txt (line 6)) Using cached https://files.pythonhosted.org/packages/90/70/f2a84fd1f8015630a1832f797143860a2f5f3f265aabde97e84bd9015539/flake8_bugbear-19.3.0-py35.py36.py37-none-any.whl Collecting flake8-string-format (from -r requirements-dev.txt (line 7)) Using cached https://files.pythonhosted.org/packages/66/91/82e2958438155bcc9f0f74c625e0d10bdced9fec7d65e54687cdf98a7b59/flake8_string_format-0.2.3-py2.py3-none-any.whl Collecting pycodestyle<2.6.0,>=2.5.0 (from flake8->-r requirements-dev.txt (line 2)) Using cached https://files.pythonhosted.org/packages/0e/0c/04a353e104d2f324f8ee5f4b32012618c1c86dd79e52a433b64fceed511b/pycodestyle-2.5.0-py2.py3-none-any.whl Collecting pyflakes<2.2.0,>=2.1.0 (from flake8->-r requirements-dev.txt (line 2)) Using cached https://files.pythonhosted.org/packages/84/f2/ed0ffb887f8138a8fe5a621b8c0bb9598bfb3989e029f6c6a85ee66628ee/pyflakes-2.1.1-py2.py3-none-any.whl Collecting entrypoints<0.4.0,>=0.3.0 (from flake8->-r requirements-dev.txt (line 2)) Using cached https://files.pythonhosted.org/packages/ac/c6/44694103f8c221443ee6b0041f69e2740d89a25641e62fb4f2ee568f2f9c/entrypoints-0.3-py2.py3-none-any.whl Collecting mccabe<0.7.0,>=0.6.0 (from flake8->-r requirements-dev.txt (line 2)) Using cached https://files.pythonhosted.org/packages/87/89/479dc97e18549e21354893e4ee4ef36db1d237534982482c3681ee6e7b57/mccabe-0.6.1-py2.py3-none-any.whl Collecting pydocstyle>=2.1 (from flake8-docstrings->-r requirements-dev.txt (line 3)) Using cached https://files.pythonhosted.org/packages/6e/3f/9207e1af3fb23c71a2a17a5d82d4c68f4dd6b3429b58514c74b95f6e0784/pydocstyle-3.0.0-py3-none-any.whl Collecting flake8-polyfill (from flake8-docstrings->-r requirements-dev.txt (line 3)) Using cached https://files.pythonhosted.org/packages/86/b5/a43fed6fd0193585d17d6faa7b85317d4461f694aaed546098c69f856579/flake8_polyfill-1.0.2-py2.py3-none-any.whl Requirement already satisfied, skipping upgrade: six in ./venv/lib/python3.6/site-packages (from flake8-print->-r requirements-dev.txt (line 4)) (1.12.0) Collecting attrs (from flake8-bugbear->-r requirements-dev.txt (line 6)) Using cached https://files.pythonhosted.org/packages/23/96/d828354fa2dbdf216eaa7b7de0db692f12c234f7ef888cc14980ef40d1d2/attrs-19.1.0-py2.py3-none-any.whl Collecting snowballstemmer (from pydocstyle>=2.1->flake8-docstrings->-r requirements-dev.txt (line 3)) Using cached https://files.pythonhosted.org/packages/d4/6c/8a935e2c7b54a37714656d753e4187ee0631988184ed50c0cf6476858566/snowballstemmer-1.2.1-py2.py3-none-any.whl Installing collected packages: pycodestyle, pyflakes, entrypoints, mccabe, flake8, snowballstemmer, pydocstyle, flake8-polyfill, flake8-docstrings, flake8-print, flake8-commas, attrs, flake8-bugbear, flake8-string-format Running setup.py install for flake8-print ... done Successfully installed attrs-19.1.0 entrypoints-0.3 flake8-3.7.7 flake8-bugbear-19.3.0 flake8-commas-2.0.0 flake8-docstrings-1.3.0 flake8-polyfill-1.0.2 flake8-print-3.1.0 flake8-string-format-0.2.3 mccabe-0.6.1 pycodestyle-2.5.0 pydocstyle-3.0.0 pyflakes-2.1.1 snowballstemmer-1.2.1 m@DESKTOP-Q6G6L03:/mnt/c/Users/cened/Desktop/archivebot-master$ ./venv/bin/activate m@DESKTOP-Q6G6L03:/mnt/c/Users/cened/Desktop/archivebot-master$ ./initdb.py Traceback (most recent call last): File "./initdb.py", line 4, in <module> from sqlalchemy_utils.functions import database_exists, create_database, drop_database ImportError: No module named sqlalchemy_utils.functions m@DESKTOP-Q6G6L03:/mnt/c/Users/cened/Desktop/archivebot-master$

Nukesor commented 5 years ago

To be honest. This is super hard too read, since it's one huge one-liner. Could you please format this properly? Try using something like pastebin.com

LoJbaDelRoito commented 5 years ago

https://pastebin.com/EL9bNzRW

Nukesor commented 5 years ago

I think I found the issue. I wrote the wrong command for activating the python virtualenv. Sorry for that. The correct one should be source ./venv/bin/activate. Try this one. Everything should install properly afterwards

Nukesor commented 5 years ago

@LoJbaDelRoito I just found some time to look at this project again :)

The installation and venv handling is now streamlined and using poetry.

I also did some cleanup/refactoring and fixed some obvious bugs. I'm going to let the bot running for a few days to check whether I can find more bugs, but for now it's looking quite good. Stickers are now btw. not longer downloaded unless explicitly specified ;)