Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python and Ubuntu
#1
Hi!

As part of my ongoing quest for a colourful world:
https://python-forum.io/Thread-colouring-strings

it seemed that my problems were due to work on Windows, so I decided to give it a try at Ubuntu, although I always thought that Linux, Ubuntu and the like were for those who already knew how to program.

Well, I managed to install Ubuntu for Windows, and as I'm a completely newbie to Ubuntu, I'm not sure if that means that Ubuntu has all the capabilities, or just the ones provided by Windows and then I'll have the same problems as before ...

I tried to use Python on bash, but while on Windows cmd prompt, python appears like this:
[Image: Python-and-Windows.png]
where it says that my version is Python 3.7.4.

On bash, on the contrary:
[Image: ubuntu-and-python.png]

if I type python, it says 'Command 'python' not found', but that I have 'python3 installed', so I typed python3 and then it said that my version is Python 3.6.7, not Python 3.7.4. So now I have a few questions:

1) Why is that?
2) Shouldn't be the same Python I'm using with Windows?
3) Is it a version pre-installed in Ubuntu?
4) How can I use my Python 3.7.4 and all the little programs that I've made on Windows, now on Ubuntu?

Sorry for bothering you again.
All the best,
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply
#2
A) Ubuntu is considered the noobs of the linux world. A lot is done for you. It is an easy distro for people from windows because you dont have to do much to maintain it.
B) Most linux distros come with python preinstalled as python runs things in linux (unlike windows)
C) Python 3.7.4 is your windows python version while Python 3.6.7 is your default linux python version. If you want to use a newer version on linux you would have to install it under linux.
D) Ubuntu on windows is installed under the windows operating system. So the path to the linux root drive should be somewhere around here
C:\Users\<windows.username>\AppData\Local\lxss\home\<ubuntu.username>\

Although i usually completely delete Windows off my HDD and install a linux distro over top of it. It appears you might want to be careful between modifying files on "Ubuntu for windows" as it could lead to file corruption. An example is window line ending are "\r\n" while unix is "\n"

E) If i want bash abilities on Windows, i just install Cygwin and put its bin directory in my windows path to execute everything in the command prompt.
Recommended Tutorials:
Reply
#3
(Sep-23-2019, 09:02 PM)metulburr Wrote: A) Ubuntu is considered the noobs of the linux world. A lot is done for you. It is an easy distro for people from windows because you dont have to do much to maintain it.
B) Most linux distros come with python preinstalled as python runs things in linux (unlike windows)
C) Python 3.7.4 is your windows python version while Python 3.6.7 is your default linux python version. If you want to use a newer version on linux you would have to install it under linux.

Thanks a lot! That answers most of my questions.

(Sep-23-2019, 09:02 PM)metulburr Wrote: D) Ubuntu on windows is installed under the windows operating system. So the path to the linux root drive should be somewhere around here
C:\Users\<windows.username>\AppData\Local\lxss\home\<ubuntu.username>\

That means that I can have access from Ubuntu to my python files on Windows?
And vice versa?

(Sep-23-2019, 09:02 PM)metulburr Wrote: Although i usually completely delete Windows off my HDD and install a linux distro over top of it. It appears you might want to be careful between modifying files on "Ubuntu for windows" as it could lead to file corruption. An example is window line ending are "\r\n" while unix is "\n"

Yeah, I'm dealing with many new things and if I involuntary disable my computer, I wouldn't know how to fix it later on.

(Sep-23-2019, 09:02 PM)metulburr Wrote: E) If i want bash abilities on Windows, i just install Cygwin and put its bin directory in my windows path to execute everything in the command prompt.

I'll have a look, but you just mentioning 'bin' and 'path' gives me shivers ... More chances for me to make serious damage to my computer ... Cry

Thanks again, and all the best,
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply
#4
(Sep-23-2019, 09:57 PM)newbieAuggie2019 Wrote: That means that I can have access from Ubuntu to my python files on Windows?
And vice versa?
I couldnt promise anything. I have never used Ubuntu for windows. Worst case scenario is you corrupt a python file moving it back and forth. It would be worth a try for sure.
(Sep-23-2019, 09:57 PM)newbieAuggie2019 Wrote: I'll have a look, but you just mentioning 'bin' and 'path' gives me shivers ... More chances for me to make serious damage to my computer ...
Putting Cygwin bin directory in the path is optional. It is only if you want to open a command prompt and execute bash commands inside a windows cmd. Otherwise you just double click the Cygwin exe and it opens up its own terminal. I just prefer to use the system temrinal/cmd. Its not that hard. This is for XP, but the process stays the same basically across windows 10. All you add is this line to windows path variable ;c:\cygwin\bin and your done. This is how to add to Win 10 path. IN windows 10 add this c:\cygwin\bin assuming that is where you installed cygwin to.
Recommended Tutorials:
Reply
#5
You have cmder as i showed you in an other Thread @newbieAuggie2019.
Then you do not need to mess with Cygwin as cmder has all tool build in.
Try ls,cat,git,ssh,find..ect commands you will see that it work.

pyenv Simple Python Version Management
Reply
#6
Hah! Cmder even has a dd. :D
Just checked.
I am using it from a while but didn't know that. Nice!

Can I use it to make a live USB as on Linux system?
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#7
(Sep-23-2019, 09:02 PM)metulburr Wrote: Putting Cygwin bin directory in the path is optional.
This is for XP, but the process stays the same basically across windows 10. All you add is this line to windows path variable ;c:\cygwin\bin and your done. This is how to add to Win 10 path. IN windows 10 add this c:\cygwin\bin assuming that is where you installed cygwin to.
Thanks a lot for your links to how to set paths!!!

I visited the cygwin page, but just the appearance of the page is so unappealing to me, that I think I'll pass on that one ... Angel
I'm a very visual person, so I've kept on investigating and I think I was gearing more to something more appealing like:

[Image: terminal-screenshot.png]

[Image: terminal-gif.gif]

It seems that you can even have an image as the background.
I managed even to change now my Windows OS Build from Windows 10 (1803), version number 10.0.17134 to Windows 10 (1903), version number 10.0.18362, as it was the minimum system requirements for the free new Windows terminal, that according to their hype:

"[The] Windows Terminal is a new, modern, fast, efficient, powerful, and productive terminal application for users of command-line tools and shells like Command Prompt, PowerShell, and WSL."

and as usual, they lied about the requirements of installation, they asked for a lot of free space in my C drive, for later asked me for a huger amount of space to use while my Windows 10 was going to be upgraded ... It took about 2 hours at least!!! and of course, they lied too saying that my files were going to be untouched ... Some little old programs I had, have dissappeared completely, and as I needed even more free space on my C drive, now some programs I moved have stopped working too!!!

(Sep-24-2019, 04:47 AM)snippsat Wrote: Try ls,cat,git,ssh,find..ect commands you will see that it work.

pyenv Simple Python Version Management

I haven't used any of those commands, as I don't know much yet. Thanks a lot for the link!

By the way, I'm using Cmder as the output terminal, that is to say, to see on it the output of the programs I write (by opening a new file with the Python 3.7.4 Shell and writing and saving them there). Can I use Cmder for writing Python programs? If the answer is affirmative, how???

(Sep-24-2019, 04:47 AM)snippsat Wrote: You have cmder as i showed you in an other Thread @newbieAuggie2019.
Then you do not need to mess with Cygwin as cmder has all tool build in.
[/url]

Yes, I know, and I thank you a lot for it, and as you can see in my colouring strings thread, I've been using it since you recommended it to me. I thought though that still didn't manage to display styles of formatting (like 'bold' or 'italic', that I really want), so I was also checking other alternatives, and I found out that with Cmder, you can use an image as a background, something that I didn't know ... Look at my Cmder now!!!:

[Image: wonderful-cmder1.png]

[Image: wonderful-cmder2.png]

[Image: wonderful-cmder3.png]

[Image: wonderful-cmder4.png]

Hooray! Now I only miss the formatting styles I want ... Dance

(Sep-24-2019, 07:28 AM)wavic Wrote: Hah! Cmder even has a dd. :D

What's a dd?

Thank you all, and all the best to everybody,
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply
#8
(Sep-24-2019, 10:16 AM)newbieAuggie2019 Wrote: What's a dd?
https://en.wikipedia.org/wiki/Dd_%28Unix%29

I must be getting old. A plain black terminal is beautiful to me. Tongue
Recommended Tutorials:
Reply
#9
(Sep-24-2019, 12:22 PM)metulburr Wrote: I must be getting old. A plain black terminal is beautiful to me. Tongue

Not only beautiful but over the years my brain has developed 'banner-blindness' and quite efficiently ignores everything which it (almost subconsciously) considers 'attention grabber by visual'.

I use customisation for taking away all what I consider 'noise'. As I am not by any means 'terminal heavyweight' I use hyper on macOS.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python in Singularity Container on Ubuntu erdemath 0 905 Aug-31-2022, 02:17 PM
Last Post: erdemath
  Python icons in Ubuntu KatManDEW 4 73,450 Aug-12-2022, 08:33 AM
Last Post: rob101
  Python 3.8 on Ubuntu 20.04 erdemath 1 1,368 Mar-07-2022, 09:31 PM
Last Post: Larz60+
  Python script in Ubuntu core Nithin_Kumar 1 3,365 May-11-2021, 01:14 AM
Last Post: Skaperen
  Python Program running a lot slower after change to Ubuntu hubenhau 1 2,891 Mar-02-2021, 05:01 PM
Last Post: Serafim
  Can't install pip for Python 3.7.4 in Ubuntu virtual OS netbids 9 6,240 Dec-31-2019, 04:42 AM
Last Post: netbids
  Python to .so library in Ubuntu for web server danowitz 0 2,072 Dec-20-2019, 06:42 AM
Last Post: danowitz
  (python-)rtmidi/Ubuntu Spiekes 1 2,370 Oct-09-2019, 10:27 PM
Last Post: metulburr
  Python 2.7 and Ubuntu 19.04? ProDigit 2 4,599 May-25-2019, 12:03 PM
Last Post: snippsat
  Changing Python Versions in Ubuntu 16.04 ErnestTBass 2 3,127 Jan-10-2019, 05:45 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020