Python: Difference between revisions

Jump to navigation Jump to search
619 bytes removed ,  3 months ago
no edit summary
(Marked this version for translation)
No edit summary
Line 141: Line 141:
<!--T:30-->
<!--T:30-->
To see where the <code>pip</code> command is installing a python package from, diagnosing installation issues, you can tell it to be more verbose with the <code>-vvv</code> option. It is also worth mentioning that when installing multiple packages it is advisable to install them with one command as it helps pip resolve dependencies.
To see where the <code>pip</code> command is installing a python package from, diagnosing installation issues, you can tell it to be more verbose with the <code>-vvv</code> option. It is also worth mentioning that when installing multiple packages it is advisable to install them with one command as it helps pip resolve dependencies.
==== Installing dependent packages ==== <!--T:35-->
<!--T:65-->
In some cases, such as TensorFlow, we provide wheels for a specific host (cpu or gpu), suffixed with <code>_cpu</code> or <code>_gpu</code>. Packages dependent on <code>tensorflow</code> will then fail to install.
If <code>my_package</code> depends on <code>numpy</code> and <code>tensorflow</code>, then the following will allow us to install it:
{{Commands|prompt=(ENV) [name@server ~]
|pip install numpy tensorflow_cpu --no-index
|pip install my_package --no-deps
}}
The <code>--no-deps</code> options tells <code>pip</code> to ignore dependencies.


=== Creating virtual environments inside of your jobs === <!--T:36-->
=== Creating virtual environments inside of your jobs === <!--T:36-->
Bureaucrats, cc_docs_admin, cc_staff, rsnt_translations
2,837

edits

Navigation menu