# How to use pip and install python package

**URL:** <https://openmc.discourse.group/t/how-to-use-pip-and-install-python-package/2318>\
**Category:** User Support\
**Created:** [September 26, 2022, 9:18am UTC](https://openmc.discourse.group/t/how-to-use-pip-and-install-python-package/2318 "2022-09-26T09:18:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dalia](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@Dalia](https://openmc.discourse.group/u/Dalia)\
**Post date:** [September 26, 2022, 9:18am UTC](https://openmc.discourse.group/t/how-to-use-pip-and-install-python-package/2318/1 "2022-09-26T09:18:53Z")

</div>

Hi everyone,

I’m don’t understand in the screenshot here where I should type the line “pip install”, I have the image debian/openmc:latest and the interactive shell running, I thought I should run pip install in it but it doesn’t work. I also have python installed. Thank you for your help.

 ![image](https://global.discourse-cdn.com/free1/uploads/openmc/original/2X/8/8bad5265553786b02de60ed4d3a4ed22650cb740.png)

---

<div class="post-metadata">

**Author:** ![Shimwell](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/shimwell/32/3876_2.png) [@Shimwell](https://openmc.discourse.group/u/Shimwell)\
**Post date:** [September 26, 2022, 11:37am UTC](https://openmc.discourse.group/t/how-to-use-pip-and-install-python-package/2318/2 "2022-09-26T11:37:41Z")

</div>

Thanks the question.

The docker images should already have had the `pip install . ` command run when they were built.

But if you want to rerun it then perhaps try navigating to the root repository folder. Which is found at /root/OpenMC/openmc

![Screenshot from 2022-09-26 12-36-32](https://global.discourse-cdn.com/free1/uploads/openmc/original/2X/8/85b074c899de4e17c5e551f54382da6a78dd62e9.png)

---

<div class="post-metadata">

**Author:** ![Dalia](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@Dalia](https://openmc.discourse.group/u/Dalia)\
**Post date:** [September 26, 2022, 12:20pm UTC](https://openmc.discourse.group/t/how-to-use-pip-and-install-python-package/2318/3 "2022-09-26T12:20:27Z")

</div>

Thank you so much for your help. Yes I have docker and I have the shell to use open MC, how can I get jupyter notebook to run blocks of code?

---

<div class="post-metadata">

**Author:** ![Dalia](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@Dalia](https://openmc.discourse.group/u/Dalia)\
**Post date:** [September 26, 2022, 12:37pm UTC](https://openmc.discourse.group/t/how-to-use-pip-and-install-python-package/2318/4 "2022-09-26T12:37:43Z")

</div>

This is what I get when I use powershell:

 ![image](https://global.discourse-cdn.com/free1/uploads/openmc/original/2X/b/b0cc2781fe7184b8fd4c21bdf8da28dd9549ef26.png)

---

<div class="post-metadata">

**Author:** ![Shimwell](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/shimwell/32/3876_2.png) [@Shimwell](https://openmc.discourse.group/u/Shimwell)\
**Post date:** [September 26, 2022, 2:04pm UTC](https://openmc.discourse.group/t/how-to-use-pip-and-install-python-package/2318/5 "2022-09-26T14:04:19Z")

</div>

When in Jupyter to run a code block in Jupyter you can click the run button which looks like a triangle or press shift and enter when on the code block.

To get Juypter into the OpenMC docker you might want to extend the dockerfile to include Jupyter.

Here is a video that might help  
[Adding Jupyter Lab to the OpenMC Docker image. - YouTube](https://www.youtube.com/watch?v=0rHxAct8tjM)

---

<div class="post-metadata">

**Author:** ![Dalia](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@Dalia](https://openmc.discourse.group/u/Dalia)\
**Post date:** [September 28, 2022, 12:34am UTC](https://openmc.discourse.group/t/how-to-use-pip-and-install-python-package/2318/6 "2022-09-28T00:34:26Z")

</div>

I tried doing everything in the video and everything worked until the code Dockerfile line, I used powershel and cmd to run it but I got an error shown in the screenshot, how can I create a docker file like the one in the video?

 ![image](https://global.discourse-cdn.com/free1/uploads/openmc/original/2X/a/a2b560a3b070285d5e082b2e20f08a2d97ff5b8f.png)

---

<div class="post-metadata">

**Author:** ![Shimwell](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/shimwell/32/3876_2.png) [@Shimwell](https://openmc.discourse.group/u/Shimwell)\
**Post date:** [September 28, 2022, 2:00pm UTC](https://openmc.discourse.group/t/how-to-use-pip-and-install-python-package/2318/7 "2022-09-28T14:00:05Z")

</div>

Oh yes sorry I should have mentioned. Code is visual studio code. It is however just used as a text editor, so you can use any text editor to make the Dockerfile. It might be easiest to open notepad from the start menu to create the Dockerfile

---

<div class="post-metadata">

**Author:** ![Dalia](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@Dalia](https://openmc.discourse.group/u/Dalia)\
**Post date:** [September 28, 2022, 3:35pm UTC](https://openmc.discourse.group/t/how-to-use-pip-and-install-python-package/2318/8 "2022-09-28T15:35:16Z")

</div>

Got it thank you so much for your help!
