What does setup.py install do to make code importable? [closed] - python

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
When I download a package and run python setup.py install, the package becomes importable. What does the command do that makes the code importable?

In most cases, setup.py installs code into locations already along sys.path (which may or may not exist along PYTHONPATH). It doesn't modify PYTHONPATH or sys.path.
Generally, the input paths listed in setup.py are assumed to be relative to the setup.py script. For packages and modules, the output paths (where files are installed) are assumed to be standard python install location for third-party packages for the current python interpreter.

Related

Cannot install Django on Windows because there is an invalid character in a filename [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I have been trying to pip install django, but I can’t do it because Windows doesn’t like the invalid filename. Do I have any options other than running a Linux virtual machine?
Make sure you have Git Bash installed (https://git-scm.com/download/win) and make sure python and pip are installed on your computer.
Once you have all that, just run Git Bash and execute pip install django. If it does not work or you have both python2 and python3 installed, use pip3 install django

How to specify dependencies in Python [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I came across a python library which has docs, which start like this:
Quickstart
Include foolib in your requirements.txt file.
AFAIK dependencies should be specified via install_requires in setup.py.
Should I talk the maintainer of the library and create a pull-request for the docs?
Both are acceptable. The difference is that specifying something in your install_requires will auto-download / install that package when you install the package using setup.py. Having a requirements.txt makes it easier to see at a glance what the requirements are. I personally prefer seeing libraries with a requirements.txt, since I can install all those requirements with pip into my virtualenv and be able to update them quickly if needed.
Add your dependencies in a requirements file and then parse this file in the setup.py. This will help you to:
Easily install dependencies without installing the entire package through pip
Get only one source for your dependencies
Get all way to install your package available (pip, easy_install, command line, etc...)

How do I install Django on Windows 10? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
Please help me. All the tutorials on the Internet on how to install Django are confusing and misleading. I understand I can download it with PIP but I have trouble with the environmental variables so I can run PIP through the Command Prompt.
Just use pip to do it. Open command prompt and write
pip install Django
And, If you are using pycharm then use
pip install django==2.2
where 2.2 is the version
If you don't have python installed I'd recommend doing that first.

Not able to install python module pycrypto [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I am trying to use a python module for using Mega and it requires me to have pycrypto installed. I tried using both pip and easy_install to install it but I have had no luck. With pip I am getting an error like this post. I followed the link from the answer in that post, but I really have no idea where to go from there. I am using Windows 7.
Pycripto is C-based extension. You can compile PyCrypto on Windows, here is a step-by-step guide.
Alternatively, you can install compiled binaries.
Here is extensive source of compiled python packages for Windows:
Unofficial Windows Binaries for Python Extension Packages

How to install the Python-RSA 3.1.1 package in Python 3.2? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
So far I've tried these methods to install the package
pip install rsa andpython setup.py install
but it seems like I installed the one for python2.7.
How can I install the one for python3.2? Or convert the 2.x to 3.x?
Many thanks.
You simply specify the version you wish to use, e.g. python3 setup.py install.

Categories

Resources