Can installin pip for python install dependencies aswell

+1 vote

I'm new to python packaging and distributing. I have a python app which I want to pip install, so I created a for it.

Now the has install_requires which alerts if a dependency is missing, but I'm wondering if I can/should provide a way to automatically install missing dependencies. Currently the app requires one self-developed shared package, and no external packages.



from setuptools import setup


Pip install output:

Collecting CommonPyLib (from TcpMonitor==1.0)
  Could not find a version that satisfies the requirement CommonPyLib (from TcpMonitor==1.0) (from versions: )
No matching distribution found for CommonPyLib (from TcpMonitor==1.0)

Sep 26, 2018 in Python by bug_seeker
• 15,550 points

1 answer to this question.

0 votes

As long as the dependency is listed in the install_requires list, it will automatically check for that module and if not present it will install it, providing that the module can be installed from PyPi. If not (where that package cannot be found on PyPi) you get a Could not find a version that satisfies the requirement error.

I could not find any packages with this name on PyPi so you need to add the dependency to be installed on PyPi to be installed via pip, if you host your package elsewhere (GitHub for example) this may provide a solution: How can I make setuptools install a package that's not on PyPI?.

Running pip install commonpylib returns

Could not find a version that satisfies the requirement commonlib (from versions: ) No matching distribution found for commonpylib

So you do not have a setup script problem but a problem with finding the package on PyPi (which does not seem to exist), or at least Python does not know where you have hosted it.

The other option is to integrate that package with what you are distributing without making it a dependency (i.e. add it to the file ect).

answered Sep 26, 2018 by Priyaj
• 58,120 points

Related Questions In Python

0 votes
1 answer

How to Install pip for python 3.7 on Ubuntu 18?

The command you're looking for is: python3.7 -m ...READ MORE

answered Nov 20, 2020 in Python by Gitika
• 65,910 points
0 votes
1 answer

Install pip in Python 3.4

Don't worry! Python already comes in default ...READ MORE

answered May 1, 2018 in Python by aayushi
• 750 points
0 votes
1 answer

How to install Python MySQLdb module using pip?

It's easy to do, but hard to ...READ MORE

answered Aug 20, 2018 in Python by charlie_brown
• 7,780 points
0 votes
2 answers

How can I install external binaries using portable python

0110100001000101001010101001011010100100111100101001 READ MORE

answered Jan 24, 2019 in Python by anonymous
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 2,182 views
0 votes
0 answers
0 votes
1 answer

How can I check for NaN in Python?

math.isnan() Checks if the float x is a ...READ MORE

answered Aug 16, 2018 in Python by Priyaj
• 58,120 points
0 votes
1 answer

Install PIP on Python 3.6

pip is bundled with Python > 3.4 On Unix-like ...READ MORE

answered Nov 12, 2018 in Python by Priyaj
• 58,120 points