#๐Ÿ”’ customtkinter 3.0 installation linux

88 messages ยท Page 1 of 1 (latest)

wanton gardenBOT
#

@brave bay

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.

brave bay
#

any help is apreciated dont really know what to do next, thanks

drifting mural
#

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

dusk fog
#

well, venvs are good

#

I used to get a lot of that problem, but a venv fixed it right up!

#

!venv

wanton gardenBOT
#
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
brave bay
drifting mural
#

do you have tkinter installed

brave bay
#

yea

drifting mural
#

if you just run import tkinter in an empty .py file do you get an error

brave bay
#

no

#

i got that to work but it dosnt detect customtkinter

drifting mural
#

yeah that squiggly line means u dont got customtkinter

#

or you're spelling it wrong

brave bay
#

yea, even tho it says this in the terminal

#

do i need to run it in vs codes terminal or is it no diffrence?

drifting mural
#

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

brave bay
drifting mural
#

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

brave bay
#

pip install customtkinter==0.3

#

without the venv

drifting mural
#

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

brave bay
#

but it still dosnt run in vs code

drifting mural
#

in vs code's terminal does it show that you activated the venv

brave bay
#

not sure

drifting mural
#

screenshot your terminal in there

brave bay
#

didnt have the teminal open

brave bay
drifting mural
#

yea

brave bay
drifting mural
#

i dont think u have to type that in vs code every time

brave bay
drifting mural
#

somewhere in vs code's settings you can set it up to activate the venv for you

brave bay
#

so its only activated in the venv?

drifting mural
#

i haven't used vs code in forever, i dont remember where u go to do it

brave bay
#

alright but just to clarify what tf i have done here haha, the customtkinter is only installed in the venv?

drifting mural
#

yea

#

when u activated the venv, and installed customtkinter its only in that venv

brave bay
#

can i have several python projects running in the same venv? never used it before

drifting mural
#

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

brave bay
#

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?

drifting mural
#

yeah that would be something u have to configure on your ide (vs code)

brave bay
#

oh alright

drifting mural
#

i use geany myself.. i dont like that ai crap

brave bay
drifting mural
#

i mean its a decent very old editor

brave bay
#

oh alright

drifting mural
#

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

brave bay
#

ill look in to that then

#

just want something simple rn tbh

drifting mural
#

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

brave bay
#

whats the diffrence between that and having an ide?

drifting mural
#

an IDE basically puts them together and has other features too like debuggers and addons and other stuff

brave bay
#

ohh alright

#

so its just the terminal and for example notepad in one?

drifting mural
#

yeah plus other stuff

brave bay
#

yea alright

drifting mural
#

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

brave bay
#

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

drifting mural
#

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

brave bay
#

yea

drifting mural
#

np

wanton gardenBOT
#
Python help channel closed using Discord native close action

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.