Python package installation | Sololearn: Learn to code for FREE!

0

Python package installation

After installing python package (numpy) using pip, I discovered that I could only use it for that particular project. How do I install the packages to make them available for all project

4/22/2020 8:04:34 AM

Kenechukwu Nzelu

2 Answers

New Answer

+3

You need to import numpy wherever you need it For example, your project has code1.py, code2.py, code3.py and code4.py Then you have to import numpy for each of them, unless you have import it in code1 and code2 imports code1, so that numpy is already imported, which you don't need to import again Or, you can write another code, imports.py for example, and import all what you need in that code, so that any other codes only need to import the imports.py and have all packages needed

0

Thanks a lot. That was helpful