wintron Posted March 2, 2016 Share Posted March 2, 2016 Hi there! I've created a workflow that I want to share with my team, the workflow includes a Python script, which in turn has a dependency on a 3rd party library (the wonderful Requests[1]). Are there any best practices around sharing this workflow with my team, whilst easing friction around the third party dependency? For example, currently I'm advocating dropping down to the command line and installing the Python dependency globally, ideally I'd like to avoid this, if at all possible. Appreciate any pointers. Kind regards! Steve [1] http://docs.python-requests.org/ Link to comment
deanishe Posted March 3, 2016 Share Posted March 3, 2016 (edited) You bundle the dependency with your workflow. End of discussion, basically. cd to your workflow in a shell and run: pip install --target . requests Asking users to install libraries is a PITA, and is very likely to cause problems down the line as Python doesn't support versioned libraries. Anything that can't be bundled probably has C extensions that need compiling, which is a world of hurt for the person supporting that. Edited March 3, 2016 by deanishe Link to comment
wintron Posted March 4, 2016 Author Share Posted March 4, 2016 Didn't know about pip install --target . So easy now, many thanks! Link to comment
deanishe Posted March 4, 2016 Share Posted March 4, 2016 My favourite pip trick: When you're not sure which Python (or pyenv etc.) the pip command is pointing to, you can use /path/to/the/python -m pip --pip --options pip args Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now