3

I am trying to install the ptyprocess module: https://github.com/pexpect/ptyprocess.

I cannot do a "pip install ptyprocess" as my pip is blocked by ssl issues on the server.

Also, I cannot clone the above repository and run a "python setup.py install" since there is no setup.py in the repository; instead there is a pyproject.toml which requires "pip install pyproject.yoml", but again, this is reliant on pip which is blocked.

How then can I install this module?

p.s. I've installed other modules on my server via github, but they have the desired "setup.py" and not "pyproject.toml", therefore I was able to run "python setup.py install" successfully.

1

2 Answers 2

1

To install a module copy the pytprocess folder (or whatever folder contains the topmost __init__.py) to your site-packages (usually in {python location}\lib\site-packages) directory. You may still need to manually install the dependencies, (in this case flit) as well. Note this only works if the package is pure python.

Sign up to request clarification or add additional context in comments.

2 Comments

Hi, thank you very much. This fixed my issue. +1. p.s. what do you mean by top __init__.py? There are two of them, each in different dirs.
In python, the precence of a __init__.py indicates that a folder is the root folder of a library. A module must either be a single file in site packages or a single folder container a __init__.py A package usually has one __init__.py for the root and possibly others in subfolders for other submodules. A __init__.py in a seperate root folder usually indicates a different related module, possibly for unit testing the main module or similar.
0

my pip is blocked by ssl issues on the server

your actual question put aside, you should also fix this issue


Coming to your question, if the package you are trying to install is on PyPi (where pip usually looks for packages), then you always have the option to manually download it first from the files section of the projects page and then install it. In this case, there are two files available:

  1. ptyprocess-0.6.0-py2.py3-none-any.whl - This is a whl file, which is a pre-packed file created by setuptools. It is compatible with both python2 and 3 versions and has no OS restrictions ("any"). Once downloaded you can install using pip install ptyprocess-0.6.0-py2.py3-none-any.whl
  2. ptyprocess-0.6.0.tar.gz This is the source code, it can be installed using pip install ptyprocess-0.6.0.tar.gz.

This solution is of course specific to packages that are available on PyPi as a workaround if pip cannot download and install the project itself. It also works to pip install on offline machines if you just download the neccessary files on a second machine and then copy them over

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.