When using tkinter with Atom, I get an Import Error


#1

How can I fix this?

Version 18.0 has been installed using pip.


#2

Do you have more than one instance of Python on your computer? What package are you using? What operating system are you on?


#3

I’m on MacOS Mojave and only have one instance of Python installed. It works completely fine when I’m using PyCharm or IDLE.

Alex Panagis
Founder & CEO @ The Mainframe


#4

What package are you using?


#5

What package should I be using?


#6

Whichever package best suits your needs. What I need to know is the package that you have been using (I’ve asked three times now) because if I know that I can probably explain what’s happening.


#7

This post was flagged by the community and is temporarily hidden.


#8

Greetings Alex.

By itself Atom is not able to run code. Before going any further, please start with what you do have right now.

The question is -
Which add-on packages do you have installed onto Atom?

More specific:
Which add-on package did you install to link Atom with Python?

Use the terminal command:
apm ls
Please write down for @DamnedScholar about the result, in your next post.


Dan Padric
Nobody in particular


#9

No, Python is working. Python is what’s giving you the error message. If you are running Python from inside Atom, there is no way you can be doing that unless you have already installed a package to run it.

There’s no package that you’re “supposed” to use. There are packages that have different architectures for different purposes, but can be used to achieve the same end goal. Packages like script and atom-runner just take your code and send it off to the compiler or interpreter, and they’re set up to save you from having to think about why and where (but can cause difficulty when the user doesn’t know what version of Python they have installed). hydrogen tries to create a Jupyter-like experience and is great for small manipulations where you want to see the output immediately. A terminal package like termination can replicate the tried and true CLI experience along with full interactivity for scripts that use input. My personal favorite is process-palette, which allows for pre-configured command line instructions that the package binds to Atom commands, so I can easily use them as keybindings or flex-tool-bar buttons and can even set local commands to ensure that, for example, a project that needs a virtual environment can have its virtualenv started before any code actually gets run.


#10

I have Hydrogen and script installed at the moment.


#11

But which one did you use when you got the Import Error?


#12

This post was flagged by the community and is temporarily hidden.


#13

Can you run your tkinter script from the Terminal without incident?