Skip to content
← Back to Community
Importing Python files
Profile icon
MartinRose

I have had problems importing my python files on repl.it but I can do it when I do it locally. I have been searching around to get an answer but all the methods have come up empty, maybe someone here can help. I have tried to import with these commands:
import TommyTheSegest
from TommyTheSegest import *
from TommyTheSegest import initiate

I named it that because I wanted to make sure that I did not collide with a command that it was trying to import from elsewhere, at least that was my intent. When I try those commands, I think my Linux tries to install an external command and I have no idea why. I get this error to be more exact:

"
Repl.it: Installing fresh packages

Collecting TommyThe Segest
Could not find a version that satisfies the requirement TommyTheSegest (from versions: )
No matching distributions found for TommyTheGreatest
You are using pip version 19.0.0, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Repl.it: package installation failed!
"

I am familiar with some Linux and sees that the pip command has less to do with Pythong and more with the Linux itself. I tryed typing the command in the console just in case but of course that did not work. What am I doing wrong?

Thanks in advance
A frustrated beginner

Answered by ArchieMaclean [earned 5 cycles]
View Answer
Voters
Profile icon
XII-MIPA-2-15Ha
Profile icon
G0RG3
Profile icon
Caidonpemper
Profile icon
ANIRUDHPG
Profile icon
Camilo1318
Profile icon
thrkturner
Profile icon
Xag803
Profile icon
SaronMajumderMa
Profile icon
LOUISREDIONANDO
Profile icon
ayanrabbani11
Comments
hotnewtop
Profile icon
ArchieMaclean

Thank you for the great explanation of your problem!

You've just made one tiny error - the other file (TommyTheSegest) is a python file, so it should be called TommyTheSegest.py. Like this:

image

Python was looking for a python file and since it couldn't find it, it tried to download one using pip, causing the error.
Once you've renamed the file, the import error should be resolved - there are also a couple of errors that are in the file that are unrelated to this problem, but I'll let you work those out yourself.

Please mark this as the answer if it solved your problem :)

Profile icon
MartinRose

@ArchieMaclean
Thank you so much. I didn't notice that. Was driving me mad.

Profile icon
ArchieMaclean

@MartinRose
No problem :)

Profile icon
SCOTBUTZBACH

@ArchieMaclean
In the picture, I think the background is in dark mode.

Profile icon
ArchieMaclean

@SCOTBUTZBACH
It is, is that a problem?

Profile icon
SCOTBUTZBACH
Profile icon
ArchieMaclean
Profile icon
G0RG3

I had the same issue, but when it actually loads, this happens:

image
is there any solution to this?
Thanks

Profile icon
Rebecca66

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me. elektronische Bauteile

Profile icon
Rebecca66

very interesting keep posting. 상품권 매입 업체

Profile icon
Rebecca66

Excellent blog! I found it while surfing around on Google. Content of this page is unique as well as well researched. Appreciate it. 소액결제 현금화

Profile icon
Rebecca66

I can’t believe focusing long enough to research; much less write this kind of article. You’ve outdone yourself with this material without a doubt. It is one of the greatest contents. ugly cartoon characters

Profile icon
Rebecca66

Theatmangroup is an online news company focused on covering the most important business and breaking news in US and around the globe. what dinosuar has 500 teeth

Profile icon
finnegan

I cannot wait to dig deep and kickoff utilizing resources that I received from you. Your exuberance is refreshing.꽁머니사이트

Profile icon
finnegan

This is a great article thanks for sharing this informative information. I will visit your blog regularly for some latest post. I will visit your blog regularly for Some latest post.Nft projects

Profile icon
CodeNinja418

@MartinRose
I still don't understand.