Error gentoo please run pip with the user option to avoid breaking python exec

Joined: 13 Jul 2014Posts: 44
View previous topic :: View next topic  
Author Message
cmrd
n00b
n00b

Joined: 13 Jul 2014
Posts: 44

PostPosted: Thu Dec 24, 2020 12:44 am    Post subject: [SOLVED] Ran pip install as normal user without virtualenv Reply with quote

Hi,

I did something stupid — I installed a few packages with pip as my normal user without the —user flag.

When I mentioned this in IRC, I was told I was supposed to get a warning not to do this.

The absence of such a warning concerns me slightly.

Nothing has broken, and I didn’t get any errors.

Are there any prophylactic steps I can take to ensure all the python packages on my system are managed by portage?

Any idea why I didn’t get a warning?

Last edited by cmrd on Thu Dec 24, 2020 1:13 am; edited 1 time in total

Back to top

View user's profile Send private message

Ionen
Developer
Developer

Joined: 06 Dec 2018
Posts: 2459

PostPosted: Thu Dec 24, 2020 12:53 am    Post subject: Reply with quote

Did you build dev-python/pip with USE=vanilla? This skips gentoo-specific patches.

Gave it a try with USE=-vanilla:

Code:
root@chroot:~# pip install zstd

ERROR: (Gentoo) Please run pip with the —user option to avoid breaking python-exec

Then tried again with USE=vanilla and it successfully installed dev-python/zstd in system directories, not even /usr/local (I see it in /usr/lib/python3.9/site-packages/zstd*) and I’m glad I can just type exit and delete this overlayfs’ upper data.

Edit: Albeit `pip uninstall zstd` seem to have cleaned enough.. not sure how much you installed with it.

Last edited by Ionen on Thu Dec 24, 2020 12:58 am; edited 2 times in total

Back to top

View user's profile Send private message

cmrd
n00b
n00b

Joined: 13 Jul 2014
Posts: 44

PostPosted: Thu Dec 24, 2020 12:57 am    Post subject: Reply with quote

Ionen wrote:
Did you build dev-python/pip with USE=vanilla?



Nope:

Code:
$ emerge -pv pip

[ebuild   R    ] dev-python/pip-20.2.4::gentoo  USE=»-test -vanilla» PYTHON_TARGETS=»python3_8 (-pypy3) -python3_6 -python3_7 -python3_9″ 0 KiB



It looks like I do get the warning if I try with root, as opposed to my normal user:

Code:
# pip install notarealpackage123

ERROR: (Gentoo) Please run pip with the —user option to avoid breaking python-exec



If I didn’t run pip install as root, does that mean I don’t have anything to worry about?

Back to top

View user's profile Send private message

Ionen
Developer
Developer

Joined: 06 Dec 2018
Posts: 2459

PostPosted: Thu Dec 24, 2020 1:02 am    Post subject: Reply with quote

Oh wait, as normal user? This won’t harm your system in any way then. Unless your normal user can write in system directories somehow.

e.g.

Code:
Defaulting to user installation because normal site-packages is not writeable

And it’ll be in $HOME/.local/lib/python* instead.

Back to top

View user's profile Send private message

cmrd
n00b
n00b

Joined: 13 Jul 2014
Posts: 44

PostPosted: Thu Dec 24, 2020 1:12 am    Post subject: Reply with quote

Ionen wrote:
Unless your normal user can write in system directories somehow.



Definitely can’t write system dirs.

Ionen wrote:
And it’ll be in $HOME/.local/lib/python* instead.



Yep, those look like the pip packages I installed.

Lovely, nothing to worry about then, thanks for the prompt replies!

Back to top

View user's profile Send private message

Display posts from previous:   

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


1

1

Сделал по мануалу setup.py, зарегался на pypi.python.org, зааплоадил туда PKG_INFO, но когда делаю python setup.py register, то получаю в ответ:

running register
running check
Registering dfclean to https://upload.pypi.org/legacy/
Server response (500): <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:720)>

В чем проблема?

from distutils.core import setup

with open('README.md') as file:
    long_description = file.read()

setup(
    name='dfclean',
    version='0.0.0.1',
    packages=['dfclean'],
    url='https://gitlab.com/panter_dsd/distfilescleaner',
    license='GPLv3',
    author='PanteR',
    author_email='panter.dsd@gmail.com',
    description='Clean up old distfiles in Gentoo',
    long_description=long_description,
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Programming Language :: Python :: 4.6',
    ]
)
cat ~/.pypirc
[distutils]
index-servers = pypi

[pypi]
repository=https://pypi.python.org/pypi
username=panter_dsd
password=*********

[server-login]
username:panter_dsd
password:*********

OS: gentoo

Python: 3.5, 3.6

Еще почему-то не могу twine установить через pip, выдает:

sudo pip install twine
ERROR: (Gentoo) Please run pip with the --user option to avoid breaking python-exec

Гугл не помог.

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.

  • Laravel photo

    Laravel

    A PHP framework for web artisans

  • 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.

  • Visualization

    Some thing interesting about visualization, use data art

  • 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.

  • Alibaba photo

    Alibaba

    Alibaba Open Source for everyone

  • D3 photo

    D3

    Data-Driven Documents codes.

  • Tencent photo

    Tencent

    China tencent open source team.

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.

  • Laravel photo

    Laravel

    A PHP framework for web artisans

  • 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.

  • Visualization

    Some thing interesting about visualization, use data art

  • 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.

  • Alibaba photo

    Alibaba

    Alibaba Open Source for everyone

  • D3 photo

    D3

    Data-Driven Documents codes.

  • Tencent photo

    Tencent

    China tencent open source team.

To solve WARNING: Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour error follow below methods.

ERROR LOG

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead

Running pip as the ‘root’ account can cause permissions to be broken and conflicting behaviour Error Because the way your container is created doesn’t allow for the creation of a user, everything is done as root. You could perform something like this to create a user and install to that user’s home directory:

FROM python:3.8.3-alpine

RUN pip install --upgrade pip

RUN adduser -D myuser
USER myuser
WORKDIR /home/myuser

COPY --chown=myuser:myuser requirements.txt requirements.txt
RUN pip install --user -r requirements.txt

ENV PATH="/home/user/.local/bin:${PATH}"

COPY --chown=myuser:myuser . .

CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]

Alternative to solve WARNING: Running pip as the ‘root’ user can result in broken permissions :

You can ignore this warning because the image was created for a single purpose and is thus as organizationally isolated as a virtual environment. Technically, no, but that’s beside the point.

It usually isn’t worth it to spend the time and effort to establish a virtual environment in an image or add a user, as suggested in the other response, just to avoid the alert, because you shouldn’t have any problems.

Check pip -V and pip3 -V to see if you need to be careful not to use pip for Python 2 when you really want pip for Python 3. But that should be all, and you won’t have that difficulty if you only install pip for Python 3.

Hope the above solution works.

Also read :

Error: cv2.error: OpenCV(4.5.2) :-1: error: (-5:Bad argument) in function ‘rectangle’
AttributeError: ‘NoneType’ object has no attribute ‘something’

Понравилась статья? Поделить с друзьями:
  • Error generating ku from authentication pass phrase
  • Error gen invalid gta 5
  • Error gc106 блок страйк
  • Error gateway timeout mikrotik httpproxy
  • Error gaster wiki