#๐ customtkinter 3.0 installation linux
88 messages ยท Page 1 of 1 (latest)
@brave bay
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.
any help is apreciated dont really know what to do next, thanks
that's the same error i get when i try to pip install the regular tkinter and so i end up having to install tkinter through linux instead of pip
well, venvs are good
I used to get a lot of that problem, but a venv fixed it right up!
!venv
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
tried using that but didnt get it to work
do you have tkinter installed
yea
if you just run import tkinter in an empty .py file do you get an error
yeah that squiggly line means u dont got customtkinter
or you're spelling it wrong
yea, even tho it says this in the terminal
do i need to run it in vs codes terminal or is it no diffrence?
doesn't matter which terminal you do it in as long as you're activating and using whatever virtual environment you have customtkinter installed to
they're both the same
how does that work then? it says its installed
on your original screenshot at the beginning of this conversation, what command did you run to get that error?
you didn't include it in the screenshot
well if you didn't activate the venv first, that's probably why you got the error
you have to activate virtual environment before you can use it
otherwise, it's going to use your system's default interpreter
and u dont want to use that
it's better to use a venv
yea thats what i did here and it seem like it worked
but it still dosnt run in vs code
in vs code's terminal does it show that you activated the venv
not sure
screenshot your terminal in there
didnt have the teminal open
rn?
yea
i dont think u have to type that in vs code every time
somewhere in vs code's settings you can set it up to activate the venv for you
so its only activated in the venv?
i haven't used vs code in forever, i dont remember where u go to do it
alright but just to clarify what tf i have done here haha, the customtkinter is only installed in the venv?
can i have several python projects running in the same venv? never used it before
you have to install custom tkinter in any venv that you use in the future
yeah you can share a venv with multiple projects
like when you get on a more serious level its not recommended to do that.. i always make a new venv for every project i make
oh alright
only thing i cant understand is, how do i assign a venv for a project? and why is it still not detecting customtkinter even when it says its installed?
yeah that would be something u have to configure on your ide (vs code)
oh alright
i use geany myself.. i dont like that ai crap
something u would recomend to a newbie?
i mean its a decent very old editor
oh alright
i've had better ngl but overall it gets the job done
pycharm is another option too.. most ppl decide between vs code and pycharm.. those are basically your top 2
yea
honestly if i were to do it all over, i would have learned from using just like a basic text editor like notepad or xed or whatever and used a terminal separately
then you get practice running basic commands like activating your venv, installing libraries, etc.
source .venv/bin/activate
pip install packagename
python3 scriptname.py
whats the diffrence between that and having an ide?
an IDE basically puts them together and has other features too like debuggers and addons and other stuff
yeah plus other stuff
yea alright
biggest reason a lot of ppl use IDE is for like the auto-completion
and syntax highlighting
it like suggests you code as you're typing
yea i dont really like the auto completion but the syntax highlighting is really beneficial
Like if i typed a capital L instead of a small it would take some tike to figure out
i feel like
yeah me too.. i always set auto-complete to take longer to activate.. if u dont it's constantly popping up when u dont want it to
that's main thing i dont like about Geany that i use now.. it doesn't have a timed-delay for the auto-complete
yea
thanks for the help!
np
This help channel has been closed. 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.