Python Forum

Full Version: problem with python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hello all! I am new to linux but I like to program and I installed linux mint 20.1, but I got problem with pip, when I writing a code with some module it says that I need to dowload it first via pip but it wont work when i start the script again, can you help me?
(Apr-27-2021, 08:29 PM)raarkil Wrote: [ -> ]Hello all! I am new to linux but I like to program and I installed linux mint 20.1, but I got problem with pip, when I writing a code with some module it says that I need to dowload it first via pip but it wont work when i start the script again, can you help me?
Will you post the code you are trying to use and also the command you used to install the module
I too am on a Linux Mint machine and I must use sudo pip3 install <module_name> if I want to have the module available in python3 instead of python2.
I did some further checks.
In Mint 20.1 there is only python3 installed.
So I suspect you had to install pip and so installed it as the information said. But pip is for python2 in which case when you installed the module it wasn't accessible from python3.
I think that what you needed to do is install python3-pip which then allows you to install the module for python3 by running
pip3 install <themodule>
#--------------
#Imports
#--------------
from Tkinter import *
#--------------
# Main Window
#--------------
mainWindow = Tk()
mainWindowTitle = Label(mainWindow, text="Our New GUI")
mainWindowTitle.pack()
mainWindow.mainloop()
I have started to work on linux system, maybe I must to learn it first, maybe you can give me what I must to know linux first?
I just want to start to build GUI via Python

  1. I have dowloaded Python for linux via official site
  2. after that I choose codium text editor to start with
  3. I set python path to folder i dowloaded
  4. I dowloaded pip with this command "apt-get install python-tk"

is this right?
From Python documentation:

Quote:Note that in general the practice of importing * from a module or package is frowned upon, since it often causes poorly readable code. However, it is okay to use it to save typing in interactive sessions.

You can read answers to StackOverflow's Why is "import *" bad? for additional tidbits.
(Apr-28-2021, 09:15 AM)perfringo Wrote: [ -> ]From Python documentation:

Quote:Note that in general the practice of importing * from a module or package is frowned upon, since it often causes poorly readable code. However, it is okay to use it to save typing in interactive sessions.

You can read answers to StackOverflow's Why is "import *" bad? for additional tidbits.
thanks so what I can do?
Pages: 1 2 3