#๐Ÿ”’ starting to code.

13 messages ยท Page 1 of 1 (latest)

grizzled roost
#

I would like to follow along with this tut. Just making a simple GUI... (Trying).
https://youtu.be/iM3kjbbKHQU

I am now at line 7, saved and runned the code. I got this in return:
No module named 'customtkinter'

I did follow the step (pip install (and did update it after, since there was a copy-paste code beside the update text in cmd)) in command box. I'm writing code in pycharm. also earlier the import function did not work with other things i tried. what is going on? where do I miss something?```import customtkinter

customtkinter.set_appearence_mode("system")
customtkinter.set_default_color_theme("dark-blue")

root = customtkinter.CTk()
root.geometry("500x350")```

In this video, we learn how to build modern-looking graphical user interfaces (GUIs) in Python.

โ—พโ—พโ—พโ—พโ—พโ—พโ—พโ—พโ—พโ—พโ—พโ—พโ—พโ—พโ—พโ—พโ—พ
๐Ÿ“š Programming Books & Merch ๐Ÿ“š
๐Ÿ The Python Bible Book: https://www.neuralnine.com/books/
๐Ÿ’ป The Algorithm Bible Book: https://www.neuralnine.com/books/
๐Ÿ‘• Programming Merch: https://www.neuralnine.com/shop

๐ŸŒ Social Media & Contact ๐ŸŒ ...

โ–ถ Play video
chrome vigilBOT
#

@grizzled roost

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

gentle onyx
#

!venv

chrome vigilBOT
#
Virtual environments

Virtual environments are isolated Python environments, which make it easier to keep your system clean and manage dependencies. By default, when activated, only libraries and scripts installed in the virtual environment are accessible, preventing cross-project dependency conflicts, and allowing easy isolation of requirements.

To create a new virtual environment, you can use the standard library venv module: python3 -m venv .venv (replace python3 with python or py on Windows)

Then, to activate the new virtual environment:

Windows (PowerShell): .venv\Scripts\Activate.ps1
or (Command Prompt): .venv\Scripts\activate.bat
MacOS / Linux (Bash): source .venv/bin/activate

Packages can then be installed to the virtual environment using pip, as normal.

For more information, take a read of the documentation. If you run code through your editor, check its documentation on how to make it use your virtual environment. For example, see the VSCode or PyCharm docs.

Tools such as poetry and pipenv can manage the creation of virtual environments as well as project dependencies, making packaging and installing your project easier.

Note: When using PowerShell in Windows, you may need to change the execution policy first. This is only required once per user:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
gentle onyx
#

The problem is almost certainly an environment issue, where you installed into one environment, and tried to run the code from another.

#

Pycharm specifically auto-activates a virtual environment in most cases. When you run pip install, make sure the terminal you're running the command in has (venv) at the start of the prompt. To make it easy, you can use the Terminal tab at the bottom of the Pycharm window, since it should auto-activate the project's environment for you.

#

@grizzled roost

grizzled roost
#

I'll read this tomorow and try.

#

thankyou! โค๏ธ

grizzled roost
#

it did work actually.

#

thank you!

chrome vigilBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.