What are site-packages in python and can you install/use them if you aren't root?

后端 未结 3 801
北恋
北恋 2021-01-13 02:35

I am trying to install lldb in Linux to my home directory on my system (I do not have root access) and I have run into a problem with a step that was trying to create a subd

相关标签:
3条回答
  • 2021-01-13 02:55

    Here is the simple code

    sudo apt-get install pip

    0 讨论(0)
  • 2021-01-13 03:06

    To answer the question as stated:

    site-packages is the location where 3rd party packages are installed (ie, not part of the core python distribution). On Linux you have to be root to write to it.

    To solve your issue:

    virtualenv is a python environment manager, which lets you for instance create your own python environments in your home directory. For an ultra-quick start with virtualenv and virtualenvwrapper (which makes virtualenv nicer to use) check out burrito.

    0 讨论(0)
  • 2021-01-13 03:20

    A possible solution that might help over all is to install virtualenv. It's a python package that helps set up some of these more annoying path redirection issues as well as gives you access to use pip and easy_install to install directly into your home directory.

    That's the long route.

    site-packages doesn't really mean much except for a known directory where python will look. You can change you PYTHONPATH environment variable to include other directories when you try to import. I'm not sure how you're installing, but a lot of times build processes allow you to specify a --prefix to tell the build and installation process where to actually output the files. I don't know enough about your particular case to be able to tell if that applies.

    0 讨论(0)
提交回复
热议问题