Coder Social home page Coder Social logo

Issue with pyside about brightness HOT 16 CLOSED

lordamit avatar lordamit commented on August 18, 2024
Issue with pyside

from brightness.

Comments (16)

elmerehbi avatar elmerehbi commented on August 18, 2024 1

@apandada1 Anaconda as @LordAmit mentioned is a Python distribution packaged for scientists and analysts. It installs in the users home directory and changes Python's path to Anacondas' python (in .bashrc, or zshrc, etc...) SO basically when I am calling python I am using the Anaconda Python and its packages.

Using apt-get will install the packages in the original Python directories which are not being used anymore. Instead pip and conda (latter is Anaconda's package manager) install the package in the Anaconda python library directories.

IN short: the apt-get install doesn't get used.

from brightness.

archisman-panigrahi avatar archisman-panigrahi commented on August 18, 2024 1

When user installs it manually, he can run pip install pyside. But a .deb package (which will be in the PPA) cannot run pip commands while installing, it resolved dependencies using apt-get. The only simple solution is to run the app with usr/bin/python so that it will work with apt-get's pyside

from brightness.

LordAmit avatar LordAmit commented on August 18, 2024

I am unfamiliar with the term Anaconda. A quick google search shows that it is probably a python distribution focusing on analytics.

I will update the readme and add instructions of installing PySide through pip 😄

Thank you for pointing this out.

from brightness.

archisman-panigrahi avatar archisman-panigrahi commented on August 18, 2024

I could not understand the problem. Please explain

from brightness.

LordAmit avatar LordAmit commented on August 18, 2024

Just that sudo apt-get install python-pyside was not enough for his system to use the app.

from brightness.

LordAmit avatar LordAmit commented on August 18, 2024

@elmerehbi , I have updated the Readme.md file. If you the instructions are better now and solves this problem - close this issue maybe?

from brightness.

archisman-panigrahi avatar archisman-panigrahi commented on August 18, 2024

Is there any command to force regular Python?
It is not easy to add the following feature to deb package:
If Anaconda Python is installed : pip install pyside after installation, (this will require adding a bash script)
otherwise, apt-get install python-pyside

from brightness.

elmerehbi avatar elmerehbi commented on August 18, 2024

@apandada1 @LordAmit I get you. You could replace apt-get install pyside with pip install pyside as in the case of Anaconda the path to Python is changed and hence the new pip is going to be used automatically. No need to use conda.

So instead of the system's package manager (apt-get here) use Python's package manager pip

from brightness.

archisman-panigrahi avatar archisman-panigrahi commented on August 18, 2024

No, that's not the solution.
I will have to add dependency in the "control" file in the .deb package.
screenshot from 2016-04-29 13-08-00

The dependencies asked here will be installed via apt (dpkg). We cannot use pip here.

What I wanted to know: Is there any specific command which will invoke original Python?
Suppose python --option src/init.py?

Or, can it be done by replacing #!/usr/bin/python with path/to/original/python in the init.py file?

from brightness.

elmerehbi avatar elmerehbi commented on August 18, 2024

@apandada1 I just checked the init.py & it includes /usr/bin/python. So there's no need to do anything as it points to the system's Python distribution. The only thing that caused a problem was calling python before the script:

python /src/init.py # returns the error I posted above
./src/init.py # works like a charm

Moreover, since I've got the ppa added I have the older version working too without the need for pyside in Anaconda's python.

from brightness.

LordAmit avatar LordAmit commented on August 18, 2024

@apandada1 , we are talking about the version 2 here.
What we can do, is create a checking mechanism for the existence of Pyside in user's python distribution when the app is run for the first time after installation through the PPA, and then automatically install python-pyside using pip if required. Or ask user to install Python-pyside using pip.

from brightness.

elmerehbi avatar elmerehbi commented on August 18, 2024

@apandada1 Doesn't running it with ./ suffice instead of explicitly calling python given that the python path is already set in the script?

from brightness.

archisman-panigrahi avatar archisman-panigrahi commented on August 18, 2024

We can mark it as executable and directly run it (without python init.py) (that's how v1 PPA works too) . Then there will be no need of checking mechanism, and the problem will be fixed.
Also, @LordAmit How can we ask the user to install using pip if the GUI of the app does not even run? By the way, the issue seems to be solved.

from brightness.

LordAmit avatar LordAmit commented on August 18, 2024

The App GUI runs using PySide, but the app itself can be loaded from a separate script which is not dependent on PySide. That part will execute just like any other Python script.

from brightness.

elmerehbi avatar elmerehbi commented on August 18, 2024

@LordAmit @apandada1 The solution to this issue is very simply:

sudo apt-get install pip 
pip install pyside

No need for sudo apt-get install pyside as pip used will depend on which python is being used by default:

which python
which pip

In my case this returns:

/home/user/anaconda2/bin/python
/home/user/anaconda2/bin/pip

To get an idea of my installation, here are my Python paths:

where python
/home/user/anaconda2/bin/python
/usr/bin/python

Installing Anaconda will install the Anacconda Python distribution in the sers home directory including all modules. Moreover, when calling python it will now call Anaconda's python.

from brightness.

elmerehbi avatar elmerehbi commented on August 18, 2024

Ah ok. Indeed /usr/bin/python should work.

from brightness.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.