Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why so complicated?
#1
I'm running python on no less than three different platforms. This is obviously my own fault, but I'm a bit puzzled all the same.

One system is running on windows 7, another is running on fedora 27 and finally I have a QPython3 app on my android phone, so I can goof around whilst in transit.

I'm well into python albeit an absolute novice; it's fun and I get a very pleasant sense of fulfilment whenever something "clicks" ot otherwise works out.

On the other hand, I also experience frustration. Not so much with the coding bit in and by itself (it's only normal that it doesn't just write itself given that I've a lot to learn still), rather my toils and endeavours seem to revolve around installing modules.

For the three aforementioned platforms everything is a bit different in those terms, even though the common denominator seems to be "difficult". The worst of the three paradoxically being Fedora (seeing as python is basically a native programme on this platform, it really ought to go more smoothly, I feel).

I've learned that I'm not to sudo pip install on the Fedora platform as it will create clutter and make my system vulnerable to outside attacks. However this is the only way I can avoid winding up with an errno 13 during installation. Pip --user install never works.

Sifting through document upon document in order to filter out one short, simple command that will enable me to install a module. Every single time. And every single time it's a new issue; there's always something missing, something extra I have to do, something that has to be "mined" out of long winded articles, not immediately available on the webpages, rather hidden somewhere on a different webpage alltogether. Absolutely wrecks my workflow, this.

Tarballs, pip install, drilling down into folders, the partridge and the pear tree. For a newbie it's not exactly easy to work out the ins and outs of it all.

I just realised that trying to run functions out of the Pillow module on Fedora requires different import commands than on Windows, and I can't help but think that this is problematic. - Will I have to run some try and except block if I want to failsafe my script, so that it will work on both platforms? Will it flake? Why didn't I buy more whiskey when I was at the shop?

The phone, well, I just diligently avoid inserting modules.

The Windows system (which I actually originally thought would give me the most grief) is mostly ok with using pip install, and I insert said modules without incident.

Why is there such a discrepancy between these methods, I wonder? Why is fedora constantly giving me error codes when it ought to work well with Python? And why hasn't these methods been streamlined a long time ago? Ought there not be a "PEP8" for devs; something to make it a little easier on everyone?

I'm not saying that I'm about to quit Python, neither am I crying myself to sleep at night, but I wonder.

What do you think?
Reply
#2
I have never used Fedora. I have installed Mint, Ubuntu MATE, and Arch. As far I can remember I had not any problems to install something with pip. Almost. Some modules require installing some C libraries but that's all. OpenCV for example.

I can't tell anything about Windows and Python because I don't use that system.

Can you be more specific which module you can't install and what is happening? You mentioned Pillow. What exactly is the issue?
Your post is quite common.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#3
It's can be difficult to start,there is a lot of stuff that's is unfamiliar.
Here my tutorial of basic usage of Python 3 on Windows and Linux.
Windows Part-1, Part-2
Linux Part-1

(Jan-27-2018, 10:06 PM)vulpesVelox Wrote: I've learned that I'm not to sudo pip install on the Fedora platform as it will create clutter
Advice follow tutorial in link about pyenv,for Fedora
Example:
mint@mint ~ $ pyenv install 3.6.2
Downloading Python-3.6.2.tar.xz...
-> https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
Installing Python-3.6.2...
Installed Python-3.6.2 to /home/mint/.pyenv/versions/3.6.2
  
# Make python and pip default to 3.6.2 or what version want to use
mint@mint ~ $ pyenv global 3.6.2
 
mint@mint ~ $ python
Python 3.6.2 (default, Jul 20 2017, 14:21:59) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
Now will pip install something always work and installing to 3.6.2,no need for sudo.
Switching back to OS default is easy to,as pyenv is safe to use it do not mess with system Python.
mint@mint ~ $ pyenv local system
mint@mint ~ $ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
mint@mint ~ $ python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
Reply
#4
(Jan-27-2018, 10:06 PM)vulpesVelox Wrote: What do you think?
I think instead of quitting Python, quit Fedora. I'm using Kubuntu and pip install --user works very well.
Reply
#5
(Jan-27-2018, 10:26 PM)wavic Wrote: I have never used Fedora. I have installed Mint, Ubuntu MATE, and Arch. As far I can remember I had not any problems to install something with pip. Almost. Some modules require installing some C libraries but that's all. OpenCV for example.

I can't tell anything about Windows and Python because I don't use that system.

Can you be more specific which module you can't install and what is happening? You mentioned Pillow. What exactly is the issue?
Your post is quite common.
Well, here's the thing: today I decided to do a full reinstall of Fedora in order to redeem sins committed at an earlier stage in life (the root install, which is ill advised), so I cannot give an exact account of all the errors that I've received. However one culprit seems to be responsible for most of the errors, namely error no. 13, which as far as I can tell has to do with permissions.

When I installed python on the win7 system, I had to check off a checkbox that had to do with python/cmd prompt communication, and thusly it works on the win system.
In Linux the installation process is somewhat different, and I suspect that there's some miscommunication between the python folder and the pip installer, however I couldn't say for sure.

Basically I'm trying to follow this tutorial as it seemed both interesting, well explained and within my capacity; I can wrap my head around the code without going cross eyed :) I realise that I have to alter a lot of the code as the article in question is a bit old, but I assumed that I could work around it, learning in the process.

The procedure is as follows: I work out what the relevant, updated modulename is and attempt 1) pip install <module name>, then proceed to add --user to the line and try again. In both cases the module downloads, tries for an installation and then returns the errno 13. Sudo pip install, however, does the trick without producing red text.

After the aforementioned reinstallation none of the modules (numPy, Pillow, PyWin) wants to play ball. the interpreter tells me that they're not recognized even though the sudo install method appeared to complete without incident. This is strange, because I've had numPy up and running before, and I'm fairly certain that I'm installing it using the same procedure as before.

Did I manage to answer your question? I'm a bit dazed by now; it's been about eight to ten hours mucking about with the machine today.

(Jan-27-2018, 10:52 PM)snippsat Wrote: It's can be difficult to start,there is a lot of stuff that's is unfamiliar.
Here my tutorial of basic usage of Python 3 on Windows and Linux.
Windows Part-1, Part-2
Linux Part-1

(Jan-27-2018, 10:06 PM)vulpesVelox Wrote: I've learned that I'm not to sudo pip install on the Fedora platform as it will create clutter
Advice follow tutorial in link about pyenv,for Fedora
Example:
mint@mint ~ $ pyenv install 3.6.2
Downloading Python-3.6.2.tar.xz...
-> https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
Installing Python-3.6.2...
Installed Python-3.6.2 to /home/mint/.pyenv/versions/3.6.2
  
# Make python and pip default to 3.6.2 or what version want to use
mint@mint ~ $ pyenv global 3.6.2
 
mint@mint ~ $ python
Python 3.6.2 (default, Jul 20 2017, 14:21:59) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
Now will pip install something always work and installing to 3.6.2,no need for sudo.
Switching back to OS default is easy to,as pyenv is safe to use it do not mess with system Python.
mint@mint ~ $ pyenv local system
mint@mint ~ $ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
mint@mint ~ $ python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

Thank you kindly; I'll have a look in the morning when I'm done hibernating ;)

(Jan-27-2018, 11:33 PM)Gribouillis Wrote:
(Jan-27-2018, 10:06 PM)vulpesVelox Wrote: What do you think?
I think instead of quitting Python, quit Fedora. I'm using Kubuntu and pip install --user works very well.
I actually found an Ubuntu distro earlier on, wondering if I might have more luck with that. I will have a go at it tomorrow, just to see.
Would you recommend Kubuntu over Ubuntu?

This is the 2nd time around you've tried to help me out in a rather short time span. Pretty soon I'll have to buy you a pizza, I think - cheers ;)
Reply
#6
When I tried Fedora 27, I installed Python libraries only through dnf. If there was no repository package for a library, then it meant the Fedora developers hadn't integrated it with the current release of their distro.

The only time I used pip was within a virtual environment (as explained above). Both virtualenv and venv are available as Fedora packages installable through dnf. I don't know whether virtualenvwrapper is because I didn't know about it.
Reply
#7
Can you tell which is the default Python version? If you run python2 or python3 as it is here is it able to import the modules.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#8
(Jan-28-2018, 12:14 AM)vulpesVelox Wrote: Would you recommend Kubuntu over Ubuntu?
I like KDE because it has a classical look and feel. I've been using it for years without problems, but it is only a personal choice.
Reply
#9
(Jan-28-2018, 05:37 AM)Gribouillis Wrote: I like KDE because it has a classical look and feel. I've been using it for years without problems, but it is only a personal choice.

Since the OP introduced this minor topic drift...

I've always found that KDE throws too many exceptions into its neat little exception popup boxes. Seriously, every time I've tried the KDE version of a Linux distro, I've gotten tons of those popup error messages. If the OP is already having problems with Fedora then recommending KDE Fedora might not be the thing to do (although, in fairness, you didn't say anything about KDE Fedora).
Reply
#10
(Jan-28-2018, 08:28 AM)league55 Wrote: I've gotten tons of those popup error messages.
I don't have this problem in Kubuntu 16.04, and there are also options in the system settings to disable some error messages if needed. I cannot say anything about Fedora because I never used this OS. I had Red Hat, but it was 15 years ago... Everything was different at that time :)
Reply


Forum Jump:

User Panel Messages

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