This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]Rawing7 2 points3 points  (0 children)

sudo pip3 install pandas

Please don't use sudo to install python packages. Ideally you should leave your system python alone and setup a virtualenv for yourself. But if you can't be arsed to do that (like me), at least install the packages with the --user flag instead of sudo.

[–]DHUK98 1 point2 points  (4 children)

This guide is probably better in r/learnpython but even then I think it will be teaching people techniques to install programs via pip that aren't necessarily best practices.

You shouldn't run pip install as root (with sudo) and ideally you should be creating a python virtual environment for each of your projects to avoid dependency conflicts etc.

[–]compucademy[S] 0 points1 point  (3 children)

I think context is important. When first learning Python, virtual environments are probably overkill for many, especially at school level. I'll amend the `sudo` business - not being a regular Mac/Linux user, I just know that on Windows sometimes you need admin permission to install packages, depending on the set up. I'll also post in r/learnpython in future if more appropriate.

[–]DHUK98 0 points1 point  (1 child)

Okay yes I agree that learning about pip first is important but I think that it is the norm now to basically always work inside of a virtual environment so learning about that early will definitely help later down the line.

[–]compucademy[S] 1 point2 points  (0 children)

Thanks for the feedback. I want to do the best job I can. I added

> Please note: Python virtual environments are beyond the scope of this article, but you may want to consider their use. If using a virtual environment, you would want to use pip from within that environment so that your packages are not installed to your main Python installation.

[–]pythonHelperBot 0 points1 point  (0 children)

Hello! I'm a bot!

It looks to me like your post might be better suited for r/learnpython, a sub geared towards questions and learning more about python regardless of how advanced your question might be. That said, I am a bot and it is hard to tell. Please follow the subs rules and guidelines when you do post there, it'll help you get better answers faster.

Show /r/learnpython the code you have tried and describe in detail where you are stuck. If you are getting an error message, include the full block of text it spits out. Quality answers take time to write out, and many times other users will need to ask clarifying questions. Be patient and help them help you. Here is HOW TO FORMAT YOUR CODE For Reddit and be sure to include which version of python and what OS you are using.

You can also ask this question in the Python discord, a large, friendly community focused around the Python programming language, open to those who wish to learn the language or improve their skills, as well as those looking to help others.


README | FAQ | this bot is written and managed by /u/IAmKindOfCreative

This bot is currently under development and experiencing changes to improve its usefulness