• 0

ATOM - editor: how to set the paths - to Python


Question

hello dear  MX-experts

 

this is a question regarding the setup of a development-environment on a MX-Linux Machine, 

 

the questioin is: with the fresh  setup of ATOM - editor: how to set the paths - to Python

 

to begin with the beginning: 

 

i am pretty new to ATOM: first steps to configure to work with Python on MX-Linux

 

just have installed ATOM on the MX-Linux.

the question is: how to set the paths - to Python.
note: i allready have installed Python on my Mx-Machine.

Which packages do you suggest me to use … to run ATOM with Python!?

 

love to hear from you

 

11 answers to this question

Recommended Posts

  • 0

hi there  I am back again 

 

 

well on my MX linux python is allready installed - so this is done by default. 

probably i need to set the paths"? 

 

 

i try to run a python code and then i see if it works 

 

 

- btw. how to get conda - i did not find it in the installer of ATOM!? 

i googled and found the following: 

https://anaconda.org/anaconda/atom
 
 Description
 Atom is a framework for creating memory efficient Python objects with enhanced features such as dynamic initialization, validation, and change notification for object attributes. 

well should i go this way: 


 To install this package with conda run:
 `conda install -c anaconda atom`

found at the above mentioned site,,,  https://anaconda.org/anaconda/atom

 

 

which things do you add to ATOM to run it as a python-coding editor... 

 

love to hear from you

  • 0

dear Pythonists - dear experts here at NeoWin 

  

i am on MX-linux which is great. but there is no vscode (or even Codium) in the repos of MX-Linux. This is a question regarding the setup of a development-environment on a MX-Linux Machine,  unfortunatly there is no VSCode in the repos - so i need some alternatives: 

 

cf: https://forum.mxlinux.org/viewtopic.php?f=55&t=55936&p=565840#p565840

note: this is sad sad sad. We need to change this pretty soon. Do you have some ideas to get things done her.

 

regarding the actual situation:- on my actual machine.- i thought of using ATOM or PyCharme  i have some experience with both of them - but ATOM i used years ago. 

so here some question regarding the setup and the configuration - and adding packages:

 

the question is: with the fresh setup of ATOM - editor: how to set the paths - to Python to begin with the beginning:-which extensions and packages do you suggest for getting started. Can you suggest some of the most important..ones?

 

as mentioned above: i am (again) pretty new to ATOM: first steps to configure to work with Python on MX-Linux

just have installed ATOM on the MX-Linux.

 

additional: - the question is: how to set the paths - to Python.

note: i allready have installed Python on my Mx-Machine: there 3.7xy is installed. 

Which packages do you suggest me to use … to run ATOM with Python!?

 

look forward to hear from you

 

yours Tarifa

 

 

update:  now i encountered something new: Unable to start the Python language server ::  python -m pip install 'python-language-server[all]'

 

the question as of today: Unable to start the Python language server ::  python -m pip install 'python-language-server[all]'

 

added a pyhton code and suddenly i  got back the following waring 

 

    Unable to start the Python language server.

    Make sure to install pyls 0.19 or newer by running:

 

and the following one: 

 

    python -m pip install 'python-language-server[all]'

 

well  - to be frank ;: i am on MX-Linux and there Pyton is installed by default. So whats the fuss?!

 

 

i am not sure what ATOM wants from me now!?

 

can any body help out here

 

  • 0
  On 20/03/2020 at 22:15, tarifa said:

 

    Unable to start the Python language server.

    Make sure to install pyls 0.19 or newer by running:    python -m pip install 'python-language-server[all]'

i am not sure what ATOM wants from me now!?

Expand  

It's literally telling you in the error message the command you need to run!

  • 0
  On 20/03/2020 at 22:32, DaveLegg said:

It's literally telling you in the error message the command you need to run!

Expand  

Hi there good  day dear DaveLegg, many thanks for the quick reply - i have used ATOM years ago - now in these  days (ih have lots of sparetime due to Corona-lockdown here) i have time to work with Atom again.  It is a headstart. 

 

At the moment i am allready running python-scripts. So some of the complaints i just dismiss. - since it works either.. 

regarding the above message : this message shows up while i add a new file to my development folder -/which does not reside in the ATOM-folder - what may be a problem. 

Well in other words i put the files into 

 

martin/dev/ python 

 

while the ATOM-Editor lies is 


 

ATOM 


Davelegg - is this possibly the issue where the complaines are rooted!? The different paths ...

 

Again - if i run the script with packages/script - then all goes well and i can see that all works propperly

 

sorry for being the novice - and for asking dump questions.

 

have a great day

  • 0

ahh hi there DaveLegg just another question - this fits here very well - i guess that i do not need to open a new thread...

 

i have added Script-package -which works fine.

 

all is well now: one question:

 

running Python-Script: with script-pagage: where to see the output - where can i see the output of the script!?

i haver the screens divided and all i see is the following:

 

 

[Finished in 3.141s]

 

 

this is the script:

 

from bs4 import BeautifulSoup
import urllib

url = urllib.urlopen('http://meinparlament.diepresse.com/')
content = url.read()
soup = BeautifulSoup(content, 'lxml')

table = soup.findAll('div',attrs={"class":"content-question"})
for x in table:
    print x.find('p').text

# Another way to retrieve tables:
# table = soup.select('div[class="content-question"]')

 

see my screen ... how all is organized... - the question is:  how can i arrange the whole ATOM so that i can see 

 

a, the script 

b. the command-line and 

c. the output!?  .... which means - the output of the little bs4-script...

 

 

love to hear from you.. 

regards tarifa

 

 

image.thumb.png.310e2d36e76c815adffb3466cf2f62be.png

  • 0

hello dear DaveLegg hello dear fellows, 

 

 

above all. well i hope you and your family is well - and all goes well in your location. How is your town dealing with covit19? I hope that we can overcome this crisis soon. 

 

ad i get continued messages and as i encounter issues day by day i just add the findings here - perhaps we can solve them in this thread.  many many thanks to you and for any and all help. 

 

the topic of today: no kernel for grammar Python found - pykernel necessary - honestly?

 

well this is pretty confusing - i can run scripts - even in python. 

but after installing hydrogen  ( cf https://atom.io/packages/hydrogen ) i have encountered funny and very confusing things. 

i want to run a little python script - and while doing a test with hydrogen>run i get back the following message: 

 

see: 

No Kernels Installed
No kernels are installed on your system so you will not be able to execute code in any language.

 

(#)[Popular Kernels](#)[All Kernels](#)

No kernel for grammar  `Python`  found

 

Check that the language for this file is set in Atom, that you have a Jupyter kernel installed for it, and that you have configured the language mapping in Hydrogen preferences.

To detect your current Python install you will need to run:

    python -m pip install ipykernel
    python -m ipykernel install --user

 

Dave - well - what is pretty confusing  - is the fact that i can run scripts - also python scripts - with the package called script: they work pretty well ... 

what goes on here - i have no glue ... see the image: 

 

 image.thumb.png.5ec325b5ab931dfb061b0bba00284d87.png

 

look forward to hear from you 

 

regards

  • 0

 

 

update: well - i guess that Hydrogen requires more than a plain Python interpreter. It provides functionality much like a Jupyter Notebook.

 

If all i  want to do is run a small script, then I guess i should  just stick to the script package, or run it in a terminal.

 

but i want to see the output of the script - this is pretty important to me. 

 

 

  • 0

hi there - well i guess that there are still some packages missing on my machine. 

 

 

see the next trial

 

from bs4 import BeautifulSoup
URL = "https://www.worldometers.info/coronavirus/"
r = requests.get(URL)
soup = BeautifulSoup(r.content, 'html5lib')
countHTML = soup.find('divttrs = {'class':'content-inner'})

for countVar in countHTML.findAll('div', attrs = {'class':'maincounter-number'}):
    count = countVar.span

 

    

    

    - i get back the following result: 

 

 

Traceback (most recent call last):   File "/tmp/atom_script_tempfiles/0c9e3b30-6d27-11ea-84a4-095d4171334a", line 2, in <module>     worldometers.info NameError: name 'worldometers' is not defined [Finished in 0.069s]


 

   

i am on MX-Linux on Atom and i do not know why i get this back!? 

 

i guess that there is something wrong

 

i have to digg deeper what goes on here. 

 

 

see the next trial

 

 

import csv
import requests
from bs4 import BeautifulSoup

URL = "https://www.passiton.com/inspirational-quotes?page={}"

quotes = []
page = 1

while True:
    r = requests.get(URL.format(page))
    print(r.url)
    soup = BeautifulSoup(r.content, 'html5lib')

    if not soup.select_one("#all_quotes .text-center > a"):break
    for row in soup.select("#all_quotes .text-center"):
        quote = {}
        try:
            quote['quote'] = row.select_one('a img.shadow').get("alt")
        except AttributeError: quote['quote'] = ""
        try:
            quote['url'] = row.select_one('a').get('href')
        except AttributeError: quote['url'] = ""
        try:
            quote['img'] = row.select_one('a img.shadow').get('src')
        except AttributeError: quote['img'] = ""
        quotes.append(quote)

    page+=1

 

 

 

i runned this and i got back the following result: 

 

 

´https://www.passiton.com/inspirational-quotes?page=1
https://www.passiton.com/inspirational-quotes?page=2..
https://www.passiton.com/inspirational-quotes?page=n..
https://www.passiton.com/inspirational-quotes?page=44´

 

and besides that ´

 

 

Traceback (most recent call last):
  File "/home/martin/.atom/python/examples/bs_values_com.py", line 31, in <module>
    with open('inspirational_quotes.csv', 'w', newline="", encoding="utf-8") as f:
TypeError: file() takes at most 3 arguments (4 given)
[Finished in 55.861s]


cf https://stackoverflow.com/questions/60796795/web-scraping-in-python-with-beautifulsoup


i am just musing how and why i receive this. i am trying to figure it out. 
any help greatly appreciated. greetings

    

   

 

dear fellows  - i look forward to hear from you - i must figure out what goes on here.

 

Edited by tarifa
  • 0

dear Davelegg dear fellows, 

 

 

first of all - i hope that you are all well and all goes okay 

 

since it seems to belong all to the same issue and the same thing i add this to this thread. 

 

 


the question today is: How can we install the Python package other than using pip?th

 

 

i run Python on MX-Linux  - there is

 

 

root@mx:/home/martin# python3 --V
unknown option --V
usage: python3 [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.
root@mx:/home/martin# python3 -V
Python 3.7.3
root@mx:/home/martin# pip install pandas
bash: pip: command not found.

 

i have no pip on the machine:  if i want to install pandas with the following command it does not work

 

pip install pandas

 

 

well i guess that i first of all need to instal pip

 

  Quote

1) Find the package at PyPI - the Python Package Index .


2) Download the source code,
3) Read the INSTALL.txt or README.txt for clue on installation.
4) Usually installation is made of these steps
     $ python setup.py   build
     $ python setup.py  install
Expand  

 

If you do not have EasyBuild installed yet, or if you just want to install the most recent version of each of the EasyBuild packages, you can use one of the following simple commands:

 

using easy_install (old tool, but still works):

 

easy_install --prefix $HOME/EasyBuild easybuild

 

Note If we already have easybuild installed, we may need to instruct easy_install to install a newer version, using --upgrade or -U.

 

using pip (more recent and better installation tool for Python software):

 

pip install --install-option "--prefix=$HOME/EasyBuild" easybuild

The --prefix $HOME/EasyBuild part in these commands allows you to install EasyBuild without admin rights into $HOME/EasyBuild.

 

 

Note For pip v8.0 and newer, pip install --prefix=$HOME/EasyBuild easybuild works too.

 

but wait: this page tells us that pip should be no my machine: 

pip is already installed if you are using Python 2 >=2.7.9 or Python 3 >=3.4 downloaded from python.org or if you are working in a Virtual Environment created by virtualenv or pyvenv. Just make sure to upgrade pip.

 

Installing with get-pip.py To install pip, securely   download get-pip.py by following this link: get-pip.py. Alternatively, use curl:

 

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

 

Then run the following command in the folder where you have downloaded get-pip.py:

 

python get-pip.py

Warning Be cautious if you are using a Python install that is managed by your operating system or another package manager. get-pip.py does not coordinate with those tools, and may leave your system in an inconsistent state.

 

so after all i am a bit confused: what  should i do - if i want to install pandas

- the questions are:

- wich options do i have to install pandas without pip 
- besides that: am i able to install pip with a simple method without running into any troubles?!?
- what should i do have to look for the preliminary steps!?
- are there any stepstones or pitfalls here !?

 

 

Dear Davelegg - sorry for adding this also to the thread - but i guess that this is quite helpful since it belongs to the same area of scope and interest. 


love to hear from you

 

 

regards 

  • 0

hi there good day 

 

i gathered more insights:  note i run the following code on MX-Linux version 19.1 (where Python runs in Version 3.7.xy) with a fresh installation of ATOM - 


cf: https://stackoverflow.com/questions/60908216/how-to-handle-multiple-urls-in-beautifultsoup-and-convert-the-data-into-datafram


 

    import requests
    from bs4 import BeautifulSoup
    import pandas as pd


    def Main(urls):
        with requests.Session() as req:
            allin = []
            for url in urls:
                r = req.get(url)
                soup = BeautifulSoup(r.content, 'html.parser')
                target = soup.find(
                    "dl", class_="c-description-list c-description-list--striped")
                names = [item.text for item in target.findAll("dt")]
                names.append("url")
                data = [item.get_text(strip=True) for item in target.findAll("dd")]
                data.append(url)
                allin.append(data)
            df = pd.DataFrame(allin, columns=names)
            df.to_csv("data.csv", index=False, encoding="utf-8")


    urls = ['https://www2.daad.de/deutschland/studienangebote/international-programmes/en/detail/4722/',
            'https://www2.daad.de/deutschland/studienangebote/international-programmes/en/detail/6318/']
    Main(urls)

 


question - how to find out where the script stores the results - the csv-file. 

can i set the paths in ATOM some how some way - are there some options to do this!?


btw:  very interesting without the encoding = "utf-8" in the line   df.to_csv("data.csv", index=False, encoding="utf-8") i have errors since ihave UnicodeEncodeError, seems that my system default encoding isn't utf-8, therefor, 



guessing:  i guess that i set up the machine /ATOM badly … - any and all help greatly appreciated. - 

 

 

    Traceback (most recent call last):
      File "/home/martin/dev/python/daad_studienangebote_url_liste.py", line 25, in <module>
        Main(urls)
      File "/home/martin/dev/python/daad_studienangebote_url_liste.py", line 20, in Main
        df.to_csv("data.csv", index=False)
      File "/usr/local/lib/python2.7/dist-packages/pandas/core/generic.py", line 3020, in to_csv
        formatter.save()
      File "/usr/local/lib/python2.7/dist-packages/pandas/io/formats/csvs.py", line 172, in save
        self._save()
      File "/usr/local/lib/python2.7/dist-packages/pandas/io/formats/csvs.py", line 288, in _save
        self._save_chunk(start_i, end_i)
      File "/usr/local/lib/python2.7/dist-packages/pandas/io/formats/csvs.py", line 315, in _save_chunk
        self.cols, self.writer)
      File "pandas/_libs/writers.pyx", line 75, in pandas._libs.writers.write_csv_rows
    UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 39: ordinal not in range(128)
    [Finished in 3.134s]

 

 

with the correct encoding the script runs very well python - daad_studienangebote_url_liste.py:21

 

i get back this result in the ATOM -.. 
 

`[Finished in 5.461s]`

 

but there remain two little questions: 

 

a. how ot set the default encoding in ATOM !? 
b. how - and where set the paths in ATOM !? 


love to hear from you 

  • 0

Dear fellows,

 

Regarding the issues: 

 

a. how ot set the default encoding in ATOM !? 
b. how - and where set the paths in ATOM !? 

 

i will digg deeper into all that

 

 

for a. i guess that the solution will be this here - a solver for the default encoding.

atom-default-encoding package:

 

 

atom-default-encoding package

 

see the link: https://atom.io/packages/default-encoding

 

image.thumb.png.d1ed03f32606ad6da0aeb58b6f35740e.png

 

what it does: Specify default encodings in config for a specific scope selector. If no config default is found, try to autodetect encoding.

 

 

 

for b. regarding the setup of python in Atom - and for the question of where the system saves the data - i found out this - hope this may help others too:

 

 

 

above all  - stay healthy - and all the best to  you both!!! 

 

have a great day.

Edited by tarifa

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • 2TB Samsung 990 EVO Plus SSD drops to a great price again by Fiza Ali The 2TB Samsung 990 EVO Plus SSD is currently available on Amazon, Samsung, and Newegg at a great price, only $0.44 higher than its historic low. So, if you have been wanting to upgrade your storage solution, you may want to check it out (purchase links down below). The SSD features NAND memory, delivering sequential read speeds of up to 7,250MB/s and write speeds of up to 6,300MB/s. For random read (QD32), the 2TB version reaches up to 1,000K IOPS, and for random write (QD32), it achieves up to 1,350K IOPS. Furthermore, it carries a Total Bytes Written (TBW) rating of 1,200. The 990 EVO Plus is equipped with Intelligent TurboWrite 2.0 for enhanced performance with large files. Moreover, the drive features a nickel-coated controller that helps manage heat, reduce power usage, and prevent overheating. The SSD supports both PCIe 4.0 x4 and PCIe 5.0 x2, promising faster data transfer speeds and better performance. Additionally, with Samsung's Magician Software, the SSD keeps its firmware up to date, adds extra security, and allows for continuous drive health monitoring. Finally, the Samsung 990 EVO Plus SSD comes with a five year limited warranty, offering long-term reliability and peace of mind. 2TB Samsung 990 EVO Plus SSD: $129.99 (Amazon US) - $129.99 (Samsung US) - $129.99 (Newegg) This Amazon deal is US-specific and not available in other regions unless specified. If you don't like it or want to look at more options, check out the Amazon US deals page here. Get Prime (SNAP), Prime Video, Audible Plus or Kindle / Music Unlimited. Free for 30 days. You can also check out other SSD deals here. For hard disk drives, you can head over to our HDD deals section to see if anything from there matches your requirements. Make sure you also browse through Amazon US, Amazon UK, and Newegg US to find some other great tech deals. As an Amazon Associate, we earn from qualifying purchases.
    • As visually pleasing as elementaryos (and pantheon) is, I found it to be a little too far behind on some things. I wish they would package their desktop environment for use on other distros. Unfortunately their dev team is pretty small and it just naturally takes a long time for them to get things polished.
    • I was thinking, and was going to post, almost exactly what @Brandon Hjust posted!   WARNING: possible spoilers I also love these videos she makes:   
    • The Witcher 4 tech demo shows off the RPG in action on a base PS5 at 60FPS by Pulasthi Ariyasinghe Epic Games' The State of Unreal 2025 keynote happened today, giving a look at its latest improvements to the Unreal Engine, and other developments and partnerships that the Fortnite maker is involved in. The show kicked things off with a bang, giving fans a live on-stage presentation of The Witcher 4 alongside developer CD Projekt RED. Seen below, the tech demo of the hugely anticipated RPG features the new trilogy's protagonist, Ciri, as she explores Kovir, the new mainland that CD Projekt is letting players explore. Following a monster trail, Ciri and her horse Kelpie go through mountains and forests before reaching the town of Valdrest. Surprisingly, the demo is said to be running on a base PlayStation 5, and it even manages to stay at 60 frames per second despite the stunning visuals. The studio said that the technologies it is using will benefit all platforms that it is targeting for the RPG. The Witcher 4 is coming to PC, Xbox Series X|S, and PlayStation 5 consoles, though a release date has not been revealed yet. "We started our partnership with Epic Games to push open-world game technology forward. To show this early look at the work we’ve been doing using Unreal Engine running at 60 FPS on PlayStation 5, is a significant milestone — and a testament of the great cooperation between our teams," said joint CEO of CD Projekt RED Michał Nowakowski. "But we're far from finished. I look forward to seeing more advancements and inspiring technology from this partnership as development of The Witcher 4 on Unreal Engine 5 continues." The demo showcases tech like Unreal Animation Framework, Nanite Foliage rendering, MetaHuman technology with Mass AI crowd scaling, and more from Epic Games' latest engine developments. Unreal Engine 5.6 is said to include many of these improvements, letting any developer use the tools on their games for better visuals and optimizations.
    • The same guy who promised AGI in a year, and later he said: yes, but no really.
  • Recent Achievements

    • Week One Done
      Adam Todd earned a badge
      Week One Done
    • Contributor
      Ed B went up a rank
      Contributor
    • One Month Later
      moporcho earned a badge
      One Month Later
    • One Month Later
      Parotel earned a badge
      One Month Later
    • Reacting Well
      Cryptecks earned a badge
      Reacting Well
  • Popular Contributors

    1. 1
      +primortal
      202
    2. 2
      snowy owl
      145
    3. 3
      ATLien_0
      133
    4. 4
      Xenon
      120
    5. 5
      +FloatingFatMan
      108
  • Tell a friend

    Love Neowin? Tell a friend!