Python: Difference between revisions

Jump to navigation Jump to search
1,018 bytes added ,  2 years ago
Added more troubleshooting points.
m (Show the command prompt for (env). Remove punctuation in title.)
(Added more troubleshooting points.)
Line 136: Line 136:


<!--T:30-->
<!--T:30-->
To see where the <tt>pip</tt> command is installing a python package from, you can tell it to be more verbose with the <tt>-vvv</tt> option.
To see where the <tt>pip</tt> command is installing a python package from, diagnosing installation issues, you can tell it to be more verbose with the <tt>-vvv</tt> option. It 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-->
==== Installing dependent packages ==== <!--T:35-->
Line 536: Line 536:
<!--T:87-->
<!--T:87-->
You can also verify that the package is available from the wheelhouse with [[Python#Available_wheels|avail_wheels]] command or by searching on [[Available Python wheels]] page.
You can also verify that the package is available from the wheelhouse with [[Python#Available_wheels|avail_wheels]] command or by searching on [[Available Python wheels]] page.
=== Installing many packages  ===
When installing multiple packages, it is best to install them in one command when possible:
{{Commands
|prompt=(ENV) [name@server ~]
|pip install --upgrade pip
|pip install package1 package2 package3 package4
}}
as this help <tt>pip</tt> resolve dependencies issues.
=== My virtual environment was working yesterday but not anymore ===
Packages are often updated and this lead to a non-reproducible virtual environment. To remedy that, one should pin the specific packages and their versions with
{{Commands
|prompt=(ENV) [name@server ~]
|pip install --upgrade pip
|pip install --no-index package1{{=}}{{=}}X.Y package2{{=}}{{=}}X.Y.Z package3<X.Y package4>X.Y
}}
and then create a [[Python#Creating_virtual_environments_inside_of_your_jobs|requirements file]] to install from when submitting jobs.


</translate>
</translate>
cc_staff
284

edits

Navigation menu