dependencies

How to resolve Python package dependencies with pipenv?

How to resolve Python package dependencies with pipenv? Question: I am using pipenv to handle Python package dependencies. The Python package is using two packages (named pckg1 and pckg2) that rely on the same package named pckg3, but from two different versions. Showing the dependency tree : $ pipenv graph pckg1==3.0.0 – pckg3 [required: >=4.1.0] …

Total answers: 14

Anaconda: Install specific packages from specific channels using environment.yml

Anaconda: Install specific packages from specific channels using environment.yml Question: does anyone know how to construct an Anaconda environment.yml file so that it installs specific packages from specific channels? Something like this: dependencies: – numpy – pandas – package-A from channel Z – package-B from channel Y All I could find is that you can …

Total answers: 1

Automatically create requirements.txt

Automatically create requirements.txt Question: Sometimes I download the python source code from github and don’t know how to install all the dependencies. If there is no requirements.txt file I have to create it by hands. The question is: Given the python source code directory is it possible to create requirements.txt automatically from the import section? …

Total answers: 26

Should I pin my Python dependencies versions?

Should I pin my Python dependencies versions? Question: I am about to release a Python library I’ve been working on the past few weeks. I’ve read a lot about Python dependencies but something is not quite clear yet: Some people pretend you should never pin your dependencies versions as it would prevent the users of …

Total answers: 3

LNK1181: cannot open input file 'm.lib'

LNK1181: cannot open input file 'm.lib' Question: When trying to install a certain Python geophysical toolkit, I get this error: LINK : fatal error LNK1181: cannot open input file ‘m.lib’ I believe it is due to my use of the MSVC’s buildtools. In their setup.py I found: setup(…, ext_modules=[ Extension(…, […], libraries=[‘m’], … ]) What …

Total answers: 2

scipy.misc module has no attribute imread?

scipy.misc module has no attribute imread? Question: I am trying to read an image with scipy. However it does not accept the scipy.misc.imread part. What could be the cause of this? >>> import scipy >>> scipy.misc <module ‘scipy.misc’ from ‘C:Python27libsite-packagesscipymisc__init__.pyc’> >>> scipy.misc.imread(‘test.tif’) Traceback (most recent call last): File “<pyshell#11>”, line 1, in <module> scipy.misc.imread(‘test.tif’) AttributeError: …

Total answers: 18

Build a dependency graph in python

Build a dependency graph in python Question: I was wondering if python has some built-in library (or any library on the net..) That will create for for me a graph of dependencies ? I have a file formatted like that A::Requires = “” B::Requires = A C::Requires = B H::Requires = A AA::Requires = “” …

Total answers: 4

How do I package a python application to make it pip-installable?

How do I package a python application to make it pip-installable? Question: I’m writing a django application in my spare time for a footy-tipping competition we’re running at work. I figured I’d use this time wisely, and get up to speed on virtualenv, pip, packaging, django 1.3, and how to write an easily redistributable application. …

Total answers: 1

python circular imports once again (aka what's wrong with this design)

python circular imports once again (aka what's wrong with this design) Question: Let’s consider python (3.x) scripts: main.py: from test.team import team from test.user import user if __name__ == ‘__main__’: u = user() t = team() u.setTeam(t) t.setLeader(u) test/user.py: from test.team import team class user: def setTeam(self, t): if issubclass(t, team.__class__): self.team = t test/team.py: …

Total answers: 5

Optional dependencies in a pip requirements file

Optional dependencies in a pip requirements file Question: How can I specify optional dependencies in a pip requirements file? According to the pip documentation this is possible, but the documentation doesn’t explain how to do it, and I can’t find any examples on the web. Asked By: del || Source Answers: Instead of specifying optional …

Total answers: 3