![]() ![]() You can now begin installing the packages your project needs. Your interpreter will automatically update in the REPL window.Ĭonfirm this by looking at the initial line in the REPL which should show /home/pi/my-python-project/.venv/bin/python3. Navigate into the newly created directory and click the OK button.Ĭlick the OK button in the Thonny options window to save your changes. You should now have new a directory called /home/pi/my-python-project/.venv. So if your project lives at /home/pi/my-python-project then navigate there and create the directory. We prefer to create the virtual environment directory as a hidden directory at the root of our project. Click the link to select a location for your new virtual environment. A new dropdown will appear in the window along with the link New virtual environment. Click on the dropdown called Which interpreter or device should Thonny use for running your code? and select Alternative Python 3 interpreter or virtual environment. Create a new virtual environmentĬlick Tools ➔ Options… and then select the Interpreter tab. Don’t worry, you don’t have to be a Python expert to use Thonny in expert mode. ![]() Once Thonny starts back up, click on Tools ➔ Options… and on the General tab, click UI Mode and select expert. In order to do this, click on Switch to regular mode in the top right corner of the toolbar. The first thing we need to do is to enable expert mode. This diverges a bit from other applications and IDEs that usually honor Pipenv or Poetry virtualenv configurations.Īfter this discovery, we started exploring the configuration section of Thonny to learn more about how it handles environments so that we could give our friend instructions. Turns out, Thonny has a built-in system that it uses to manage virtual environments. We installed said application, Thonny, on our Raspberry Pi and fired it up to try to figure out why it was not honoring the virtualenv directory created by Poetry. We recently helped an online friend with an application that was completely new to us. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |