Python Forum
problem with python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem with python
#1
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?
Reply
#2
(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
raarkil likes this post
Reply
#3
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.
raarkil likes this post
Reply
#4
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>
raarkil likes this post
Reply
#5
#--------------
#Imports
#--------------
from Tkinter import *
#--------------
# Main Window
#--------------
mainWindow = Tk()
mainWindowTitle = Label(mainWindow, text="Our New GUI")
mainWindowTitle.pack()
mainWindow.mainloop()
Reply
#6
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?
Reply
#7
I just want to start to build GUI via Python
Reply
#8

  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?
Reply
#9
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.
raarkil likes this post
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply
#10
(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?
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020