Unable to run.Is it in your path?(Atom,Ubuntu)

#1

Hey! Just started learning,so pretty newbie issue.
I’m trying to run a simple hello world script on atom but i get this
"Did you start Atom from the command line?

atom .
Is it in your PATH?

PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin "
I started it from the terminal but it doesn’t resolves the issue.Any help ?

0 Likes

#2

Atom has no ability to run code that isn’t its own JavaScript. In order to run code, you have to be using a community package. In order for us to help you, we need to know what packages you are using.

i get this

From where do you get that? If you don’t know how to describe a particular error message, you can provide a screenshot and we can explain what you are seeing.

0 Likes

#3

I’m using a script package by rgbkrk and here is a screenshot:

0 Likes

#4

What happens when you type python --version into the command line?

0 Likes

#5

Hey, I know I’m late to this party…
But I have the same problem, and I’m also a newbie to basically all of this (this includes; Ubuntu, Python (programming in general) and Atom) but I kind of hope you can help me. Since you answered Dexterious here.
But you never got an answer on the last text, I hope by my answering it, you might be able to locate my problem…

For reference, I’m using Ubuntu 18.04.1

Anyway, when I write python --version it says I don’t have Python, but that I do have Python3
So I did python3 --version and I get Python 3.6.7.
I hope that tells you something…Other than my apparent version of Python.

This is mine, and the same error message:

id you start Atom from the command line?

atom .

Is it in your PATH?

PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

0 Likes

#6

Yeah, that’s strange. Is it possible that you uninstalled Python 2 at some point?

Tell me what you see when you run where python3. Then take that file path and run ls with the argument (the text immediately following the command) as the path that where tells you.

0 Likes

#7

hi! thank you for responding so quickly, actually I found your comment on a similar post, which helped me. Apparently I needed to install the “python” package, since Atom couldn’t support python3.

0 Likes

#8

Like Windows 10, in Ubuntu 18.04 python 2.7 is fading away as default python and python 3 is taking over. I am on Ubuntu 16.04 and python 2.7 is the default. This can be confusing when running different versions.

0 Likes

#9

Please post a link to the comment you’re referring to. I know I said no such thing, because it’s not true and I am always extremely precise in how I talk, especially about technical topics like this (Atom doesn’t support anything, script does, and script can be easily configured as long as all you want to do is change the command from python to python3.

If you look at the readme for the python package, you’ll see that the author (the same person who wrote script) says to not use it any more. I strongly recommend against it as a solution. Instead, if you answer my previous questions, I can give you a stable, long-term solution customized for your computer that will help you whether you want to run python from another application or the terminal.

0 Likes

#10

Hi, this is the link to the question, your comment is here: HELP: Unable to run Python on Atom

I didn’t do exactly what you said, but I realized that what I had was python3 and that Atom wanted python, as you said in the comment. And so I installed that with a command the terminal actually gave me. I can’t find it again though, as python is installed now.

When you say script are you referring to the package? can you explain to me why I shouldn’t use it anymore?

To answer your previous question though; where python3 gives where: command not found and so i’m not sure what to do with the rest of the things you said.

0 Likes

#11

And what I actually wanted to recommend to you is exactly the same command that I used in that thread; I just needed to make sure where the Python executable was sitting first (different Linuxes do it differently).

That is the package you are using to run code, yes.

can you explain to me why I shouldn’t use it anymore?

I actually said that you shouldn’t use the package python by the same author (because he said that you shouldn’t), but I also think that script is too limited and its “best” feature is that it obfuscates the command line interaction by making you not have to think about the command you’re running. It’s actually really beneficial to developers in general to be very comfortable with the command line, and there are a ton of tools in the Python world that use the system shell to run scaffolding scripts or start webservers or lint code or numerous other tasks, so I do not believe that it is healthy as a developer to remove yourself from interacting with the command line. I think that process-palette is the most flexible and powerful option and the only other package that compares is atom-shell-commands, which does the same thing but with an interface that I find less to my liking than process-palette.

My point about being comfortable on the command line is doubly relevant for people using Linux. You don’t need to do most stuff on the command line any more, it just makes your life a whole lot easier if you have a reason to practice a bit and learn some of the tricks and lingo so that, when you’re in strange territory, you can Google around and follow the tutorials written by Linux gurus. That’s what I do.

To answer your previous question though; where python3 gives where: command not found and so i’m not sure what to do with the rest of the things you said.

That’s my fault. I work primarily on Windows where the command is where. The correct command for Linux/Mac is which, which makes less sense grammatically than where (probably the only stock command where Windows got it right, because all of the others are better on Unix systems) and I had a slip of the mind. You should run which python3. That will give you a filepath. You will then run the ls -la command (the switches are another thing I slipped up and forgot due to the length of time since the last time I did it) with that filepath (for instance, ls -la /usr/bin/python3 if that’s the path you get) to identify where the symbolic link is pointing to. You can then run the same sudo ln command to create a symbolic link named /usr/bin/python that points at the Python executable (which is better than the solution I posted in August because I just told the user to point one symlink at another, which is prone to breaking if /usr/bin/python3 ever got deleted).

0 Likes

#12

Ok, well I’m not using the python package that you’re referring to, I am using script. And what you’re saying is, that in order for me to get more comfortable with what is the terminal on Linux I need to use another package instead called process-palette, or I could use atom-shell-commands? I can do that, it seems like a good idea to get more comfortable with terminal, now that I’m using Linux.

When I do which python3 I get; /usr/bin/python3
I did ls -la /usr/bin/python3 and got lrwxrwxrwx 2 root root 25 Mar 21 14:39 /usr/bin/python3 -> /etc/alternatives/python3 this is creating a symlink?

The next one I’m not entirely sure about. when I do sudo ln /usr/bin/python I get ln: failed to create hard link './python': File exists
For the record, I did do which python and got /usr/bin/python because the file exists, as I did download python yesterday.
But I’m not sure why you want me to create a symlink now either? As I said, downloading python made it work with Atom.

0 Likes

#13

In your previous post, you said:

What did you mean if not the package for Atom?

It’s not the only way, but it’s definitely a good way.

I did ls -la /usr/bin/python3 and got lrwxrwxrwx 2 root root 25 Mar 21 14:39 /usr/bin/python3 -> /etc/alternatives/python3 this is creating a symlink?

No, that’s checking the symlink at /usr/bin/python3. Creating a symlink is what ln does.

when I do sudo ln /usr/bin/python

In the previous comment, I said:

If you read that command string carefully and follow the link, you’ll see that the first filepath entered is the target, which is the file that already exists, and the second file is the name of the link you’ll be creating. Obviously, if you’ve downloaded a package that did the symlink creation for you, you don’t have to do it yourself.

As I said, downloading python made it work with Atom.

You said that you downloaded a package called python. You didn’t mention that it was a Linux package, not an Atom package, and when I pointed out the Atom package by that name, you didn’t say anything about it. When you install a package on Linux, you’re going to use a program like apt-get or Synaptic, and mentioning one of those is a good way to signal the context of your statement. You can also mention that you downloaded Python 2 or Python 3, whichever the case may be.

0 Likes

#14

yes, sorry, I did mean a python package for Linux; python 2. I used the apt- get command to download it.
It was just classified as python and not python2 as opposed to python 3 being classified aspython3 so that’s why I just said; "python package". Sorry for the confusion.

And thank you, I was a bit confused about the symlink thing. Downloadingpython might have just created the symlink for me then.

1 Like