PyBites-Open-Source/karmabot

Cant install with pip

Closed this issue · 6 comments

Hi folks,
I am trying to install karmabot with pip on CentOS 7 and got the message below:

ERROR: Could not find a version that satisfies the requirement karmabot (from versions: none)
ERROR: No matching distribution found for karmabot

Any insight?
Thank you

Will take a look at this

Can't reproduce this on docker centos:centos7

[root@1480fa813dc1 ~]# python3.7 -m venv .venv
[root@1480fa813dc1 ~]# source .venv/bin/activate
(.venv) [root@1480fa813dc1 ~]# pip install karmabot
Collecting karmabot
  Using cached karmabot-1.2.tar.gz (20 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting humanize<3.0.0,>=2.4.0
  Using cached humanize-2.6.0-py3-none-any.whl (68 kB)
Collecting feedparser==5.2.1
  Using cached feedparser-5.2.1.tar.bz2 (192 kB)
Collecting importlib-metadata<2.0.0,>=1.6.1
  Using cached importlib_metadata-1.7.0-py2.py3-none-any.whl (31 kB)
Collecting python-dotenv<0.14.0,>=0.13.0
  Using cached python_dotenv-0.13.0-py2.py3-none-any.whl (17 kB)
Collecting SQLAlchemy<2.0.0,>=1.3.17
  Downloading SQLAlchemy-1.3.19-cp37-cp37m-manylinux2010_x86_64.whl (1.3 MB)
     |████████████████████████████████| 1.3 MB 2.5 MB/s
Collecting slackclient==1.3.1
  Downloading slackclient-1.3.1.tar.gz (20 kB)
Collecting psycopg2<3.0.0,>=2.8.5
  Using cached psycopg2-2.8.6.tar.gz (383 kB)
Collecting pyjokes<0.7.0,>=0.6.0
  Using cached pyjokes-0.6.0-py2.py3-none-any.whl (26 kB)
Collecting zipp>=0.5
  Using cached zipp-3.1.0-py3-none-any.whl (4.9 kB)
Collecting websocket-client<0.55.0,>=0.35
  Downloading websocket_client-0.54.0-py2.py3-none-any.whl (200 kB)
     |████████████████████████████████| 200 kB 7.9 MB/s
Collecting requests<3.0a0,>=2.11
  Using cached requests-2.24.0-py2.py3-none-any.whl (61 kB)
Collecting six<2.0a0,>=1.10
  Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting chardet<4,>=3.0.2
  Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting idna<3,>=2.5
  Using cached idna-2.10-py2.py3-none-any.whl (58 kB)
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
  Using cached urllib3-1.25.10-py2.py3-none-any.whl (127 kB)
Collecting certifi>=2017.4.17
  Using cached certifi-2020.6.20-py2.py3-none-any.whl (156 kB)
Using legacy setup.py install for feedparser, since package 'wheel' is not installed.
Using legacy setup.py install for slackclient, since package 'wheel' is not installed.
Using legacy setup.py install for psycopg2, since package 'wheel' is not installed.
Building wheels for collected packages: karmabot
  Building wheel for karmabot (PEP 517) ... done
  Created wheel for karmabot: filename=karmabot-1.2-py3-none-any.whl size=24134 sha256=d711386a82d3a23f1681949f0fc071c88640f777a054a507112302ea336ad89e
  Stored in directory: /root/.cache/pip/wheels/f1/0a/fc/703edde6f75042f2d0662449987245406b5e3161ee475ab210
Successfully built karmabot
Installing collected packages: humanize, feedparser, zipp, importlib-metadata, python-dotenv, SQLAlchemy, six, websocket-client, chardet, idna, urllib3, certifi, requests, slackclient, psycopg2, pyjokes, karmabot
    Running setup.py install for feedparser ... done
    Running setup.py install for slackclient ... done
    Running setup.py install for psycopg2 ... done
Successfully installed SQLAlchemy-1.3.19 certifi-2020.6.20 chardet-3.0.4 feedparser-5.2.1 humanize-2.6.0 idna-2.10 importlib-metadata-1.7.0 karmabot-1.2 psycopg2-2.8.6 pyjokes-0.6.0 python-dotenv-0.13.0 requests-2.24.0 six-1.15.0 slackclient-1.3.1 urllib3-1.25.10 websocket-client-0.54.0 zipp-3.1.0
WARNING: You are using pip version 20.1.1; however, version 20.2.3 is available.
You should consider upgrading via the '/root/.venv/bin/python3.7 -m pip install --upgrade pip' command.

Make sure you have at least Python 3.7 installed and all required compiling tools (e.g., gcc + postgresql-devel).
Another problem could be when do not point to the correct python/pip instance. Try creating an clean venv with Python 3.7+.

Hi,
I managed to at least run the command by creating a fresh debian image and using Python 3.8.5 VENV, however now I am facing this issue:
`Collecting psycopg2<3.0.0,>=2.8.5
Using cached psycopg2-2.8.6.tar.gz (383 kB)
ERROR: Command errored out with exit status 1:
command: /root/my_app/my_app_venv/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-np_v37g1/psycopg2/setup.py'"'"'; file='"'"'/tmp/pip-install-np_v37g1/psycopg2/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 /tmp/pip-pip-egg-info-df6l_fpn
cwd: /tmp/pip-install-np_v37g1/psycopg2/
Complete output (23 lines):
running egg_info
creating /tmp/pip-pip-egg-info-df6l_fpn/psycopg2.egg-info
writing /tmp/pip-pip-egg-info-df6l_fpn/psycopg2.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-pip-egg-info-df6l_fpn/psycopg2.egg-info/dependency_links.txt
writing top-level names to /tmp/pip-pip-egg-info-df6l_fpn/psycopg2.egg-info/top_level.txt
writing manifest file '/tmp/pip-pip-egg-info-df6l_fpn/psycopg2.egg-info/SOURCES.txt'

Error: pg_config executable not found.

pg_config is required to build psycopg2 from source.  Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:

    python setup.py build_ext --pg-config /path/to/pg_config build ...

or with the pg_config option in 'setup.cfg'.

If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.

For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).

----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
`

If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.

Try installing the required tools to build this dependency from source: sudo apt install libpq-dev python3-dev if you are using the python version coming with your distro. Then retry pip install karmabot and everything should work.

If you use different/multiple versions of python, e.g. deadsnakes, you need to install the corresponding dev-tools. For deadsnakes Python 3.8 this would be sudo apt install python3.8-dev

It worked!
My feedback is that maybe you guys could add on the README a tutorial on how to install since the beginning, that would be in hand for starter users like me.
Thank you

Thanks for the feedback.

We will either put the info in the Readme or figure out a way to avoid the compiling requirement for psycopg2.