Uncaught TypeError: "file" argument must be a non-empty string


#1

running atom on mac 10.13 and i’m trying to start to study python, but when I run the program this happens. i believe i have all the relevant compilers and scripts downloaded, so what could the problem be? please help a complete newb out


#2

Hello.

Please; more information is needed than what you have supplied now.

Which add-on packages have you loaded onto Atom that executes a Python script? Which Python version have you installed on your PC?

Of those packages, do make sure that all the configuration settings are configured. My first guess is that some package does not know where you have installed Python.

Regards.


#3

here are the currently downloaded python packages. i’m completely new to atom and programming in general, so forgive me if I’ve missed something.


#4

also, I have downloaded the latest mac python (it’s 3.7 i think), but I don’t like the IDE that comes with it so i want to use python on atom instead.


#5

the third image in that album appeared just recently, when i tried to open a program in python.


#6

Python has to be installed on your system and needs to be registered in your “PATH”.

The last image you shared in the album requests that the language server be installed. The “pip” is a Python package manager type system AFAIK.

Packages in Atom is any many cases only the middleman between Atom and some application (such as Python). In many cases these applications are terminal running programs. Please read carefully all the instructions and configurations supplied with each Atom package you install.

Good luck.


#7

I already donwloaded the install package from python.org. is that not the right one? is it not compatible with atom?


#8

That sounds good to me. That is the official version (and the only one I would trust).

The packages still needs configuring and may request some additional installs like the message you reported on last. Have you done that yet?


#9

The fact that the script returned a TypeError indicates that Python was run successfully. The first place I’d look is at the script itself to make sure that the file argument isn’t a non-empty string, but we don’t have the script code to look at.


#10

it’s asking me download the ting on the third picture, but I don’t know how to, sadly.


#11

i’m very new to atom, could you explain how i’d open this script and file argument that you’re talking about?


#12

You are trying to run it and getting the error you posted in the subject of this thread. You already have it open, or did, because you wouldn’t have been able to run it from Atom without opening it.


#13

I was referring to this, what kind of mistake is this? for reference, all I did was type

print('hello')

and when I pressed compile and run, that error popped up.


#14

What package did you use for that? What happens if you open the command line, navigate to your code folder, and run the command python python.py?


#15

all the packages I downloaded are in the imgur link i sent above. about your second statement, how exactly do i do that? i’m terribly sorry but i’m unfamiliar with atom’s controls.


#16

That doesn’t have anything to do with Atom. You haven’t told me what operating system you’re using, but I can guarantee you that you have a command line application that you can open up to run scripts, and since you’re learning Python you should be invested in learning how to use your command line effectively (it comes up frequently when working with different tools and frameworks, and is essential when managing packages for large projects).