Coder Social home page Coder Social logo

Comments (8)

jjhelmus avatar jjhelmus commented on July 24, 2024

@Michael-F-Ellis It looks like the system pip is getting called and setproctitle is getting installed into the system Python's site-packages directory. Try install pip into the conda environment using conda install pip and then installing setproctitle. You can also check which pip is getting called with which pip. To install packages into the conda environment the path should include the berryconda directory.

from berryconda.

Michael-F-Ellis avatar Michael-F-Ellis commented on July 24, 2024

Thanks for the quick response! Forgot to mention that I tried that earlier. Tried it again. Here's what happens:

(py27) pi@pi2:~ $ conda install pip
Fetching package metadata .....
Solving package specifications: ..........

Package plan for installation in environment /home/pi/berryconda3/envs/py27:

The following NEW packages will be INSTALLED:

    certifi:    2017.4.17-py_0
    packaging:  16.8-py27_0   
    pip:        9.0.1-py27_0  
    pyparsing:  2.2.0-py27_0  
    setuptools: 35.0.1-py27_0 
    six:        1.10.0-py27_0 
    wheel:      0.29.0-py27_0 

Proceed ([y]/n)? y

Linking packages ...
Installing certifi-2017.4.17-py_0 requires a minimum conda version of 4.3.
(py27) pi@pi2:~ $ which pip
/usr/local/bin/pip  

from berryconda.

Michael-F-Ellis avatar Michael-F-Ellis commented on July 24, 2024

Thought for a moment I had it fixed by going to my root python3.5 environment and conda installing pip there. That succeeded and I got setproctitle to install and import in python 3.5. But then I switched back to 2.7 to try things there. I was able to get conda install pip to succeed and pip install setproctitle now finds in the berryconda 3.5 site package. But it still won't import into py 2.7

(py27) pi@pi2:~ $ conda install pip
Fetching package metadata .....
Solving package specifications: .

Package plan for installation in environment /home/pi/berryconda3/envs/py27:

The following NEW packages will be INSTALLED:

    certifi:    2017.4.17-py_0
    packaging:  16.8-py27_0   
    pip:        9.0.1-py27_0  
    pyparsing:  2.2.0-py27_0  
    setuptools: 35.0.1-py27_0 
    six:        1.10.0-py27_0 
    wheel:      0.29.0-py27_0 

Proceed ([y]/n)? y

(py27) pi@pi2:~ $ which pip
/home/pi/berryconda3/envs/py27/bin/pip
(py27) pi@pi2:~ $ pip install setproctitle
Requirement already satisfied: setproctitle in ./berryconda3/lib/python3.5/site-packages
(py27) pi@pi2:~ $ python
Python 2.7.13 | packaged by rpi | (default, Jan 15 2017, 19:52:30) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import setproctitle
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named setproctitle

from berryconda.

Michael-F-Ellis avatar Michael-F-Ellis commented on July 24, 2024

Got it working by a bit of trickery.

  1. In the root environment, I moved the setproctitle .so and dist-info files to /tmp
  2. Switched to( py27) and did pip install setproctitle. This time it worked.
  3. Verified it would now import.
  4. Switched back to (root)
  5. Moved files back from /tmp to /berryconda3/lib/python3.5/site-packages/
  6. Verified that setproctitle imports ok in (root)

Hope you can find a better solution.

Cheers,
Mike

from berryconda.

jjhelmus avatar jjhelmus commented on July 24, 2024

Odd, I tried to replicate this and was able to installing pip and then setproctitle into a python 2.7 conda environment without issue.
I wonder if something is pip's caching logic was causing a previous build of setproctitle to be found when installing into one of the environments? In the future it might be helpful to see if clearing the cache helps, rm -rf ~/.cache/pip will do that, or add --no-cache-dir to the pip install command. Other than that I'm not sure what else to try, but I'm glad you found a solution.

I can create setproctitle conda packages without to much effort if that would help.

from berryconda.

Michael-F-Ellis avatar Michael-F-Ellis commented on July 24, 2024

I think you're probably right about the cache. It kind of makes sense given that the PI already had a number of pip-installed packages including setproctitle before I installed berryconda for Python 3.

Setproctitle is useful in my work on control systems that have multiple processes running. I use it to apply a common tag so I can use ps and pkill to inspect and control them from the command line. Not sure many other people use it, so packaging it might not be the best leverage for your time. I do appreciate the offer, though, and would certainly use it if it were available.

Cheers,
Mike

from berryconda.

jjhelmus avatar jjhelmus commented on July 24, 2024

I created packages for setproctitle and uploaded them to the rpi channel. In the future you should be able to install the package using conda install setproctitle rather than using pip.

from berryconda.

Michael-F-Ellis avatar Michael-F-Ellis commented on July 24, 2024

Awesome. Thanks!

from berryconda.

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.