question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do I bootstrap packages available only within pip for running on Batch

See original GitHub issue

Running on AWS I would usually define a step:

@batch(cpu=1, memory=5000)
@conda(libraries={'pandas': '1'})
@step
def hello(self):
    do stuff...

However, I am working with deeplearning libraries (MXnet/tensorflow/pytorch), and they are not particularly up to date on conda and it is best to install with pip.

How do I define pip dependancies for this step?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

3reactions
dibgergecommented, Dec 8, 2020

Thanks, this solved it! I didn’t see the topic. I was looking at the docs, and I used the command there: os.system('pip install my_package'), which was invoking the wrong python interpreter in the container. Didn’t occur to me to use sys.executable.

Are there plans to integrate this to have something like this instead:

@conda(libraries={...}, pip={...})

so that pip libraries can be cached along with the conda libraries in s3?

1reaction
savingoyalcommented, Dec 7, 2020

@dibgerge There is some discussion on that topic in #24. You can install your pip packages in your step by executing - subprocess.run([sys.executable, '-m', 'pip', 'install', '--quiet', ...]).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Python's pip to Manage Your Projects' Dependencies
In this example, you run pip with the install command followed by the name of the package that you want to install. The...
Read more >
How to Install Pip on Windows - ActiveState
Click on the Advanced system settings link on the left panel; Click Environment Variables; Under System Variables, double-click the variable ...
Read more >
'pip' is not recognized - python - Stack Overflow
'pip' is not recognized ; run windows cmd, go to your python script dir (example cd C:\Python27\Scripts) then run pip. – ssnake. Apr...
Read more >
Add support for plain pip package installation (similar to Conda)
How do I bootstrap packages available only within pip for running on Batch #395. Open. sappier pushed a commit to sappier/metaflow that ...
Read more >
How to Install PIP on Windows: A Simple Guide with ...
In more practical terms, PIP is a widely used package-management system designed to install libraries that aren't included in the standard ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found