git and pywb

b1bb2

New Member
I am trying to install pywb onto a local virtual machine environment (folder). System is debian 11.3 (Bullseye), Local Personal Computer. with Python 3.10.6, which has pip and setuptools. I understand it might not run here, this excersise is only to figure out how to install it. What am I doing wrong? Should I put git somewhere else?

# download pywb archive.
mkdir -p /home/bullseye/test/pywb/2.6.7/plain
cd /home/bullseye/test/pywb/2.6.7/plain
wget https://github.com/webrecorder/pywb/archive/refs/tags/v-2.6.7.tar.gz

# list pywb archive.
ls /home/bullseye/test/pywb/2.6.7/plain/v-2.6.7.tar.gz

# extract pywb archive
cd /home/bullseye/test/pywb/2.6.7/plain
tar -xvf v-2.6.7.tar.gz

# read pywb documentation
nano /home/bullseye/test/pywb/2.6.7/plain/pywb-v-2.6.7/INSTALL.rst

# git
cd /home/bullseye/test/pywb/2.6.7/plain/pywb-v-2.6.7
git init
git add .
git commit

# try install
/home/bullseye/test/Python/3.10.6/ensurepip/Python-3.10.6/python /home/bullseye/test/pywb/2.6.7/plain/pywb-v-2.6.7/setup.py install

# error message
bullseye@debian:~$ /home/bullseye/test/Python/3.10.6/ensurepip/Python-3.10.6/python /home/bullseye/test/pywb/2.6.7/plain/pywb-v-2.6.7/setup.py install
fatal: not a git repository (or any of the parent directories): .git
Traceback (most recent call last):
File "/home/bullseye/test/pywb/2.6.7/plain/pywb-v-2.6.7/setup.py", line 93, in <module>
long_description=get_long_description(),
File "/home/bullseye/test/pywb/2.6.7/plain/pywb-v-2.6.7/setup.py", line 14, in get_long_description
with open('README.rst', 'r') as fh:
FileNotFoundError: [Errno 2] No such file or directory: 'README.rst'
bullseye@debian:~$
 

Cromewell

Administrator
Staff member
Why not simply pip3 install pywb?

Or even better, create a virtualenv
Code:
python3 -m venv myenvname
source myenvname/bin/activate
pip3 install pywb
Pip is able to fetch from Pypi.
 

b1bb2

New Member
Thank you Cromewell. I ran this several ways and always get the same error and then terminal freezes.
bullseye@debian:~$ pywb
[Errno 2] No such file or directory: './config.yaml'
2022-08-22 16:58:03,761: [INFO]: Starting Gevent Server on 8080

bullseye@debian:~$ ls ./config.yaml
ls: cannot access './config.yaml': No such file or directory
bullseye@debian:~$
 

Okedokey

Well-Known Member
Hardcode the references in code? Also, are all versions of python meant to be the same?
 
Last edited:

b1bb2

New Member
To: Okedokey, Well-Known Member

I guess you mean I should try several versions of python? Looks like the best version I have is python 3.9.2 global. I have several local versions that I need to re-compile to get ssl module. Never done that before, but I hear I need to edit ptyhon/Modules/Setup.dist and uncomment some code. Is this what you mean by Hardcode the references in code? I can do that but it will take time. In code box is my python versions and error messages.

Code:
# test by getting version.  Python 2.7.3 local
/home/bullseye/test3/Python/2.7.3/ensurepip/Python-2.7.3/python --version
bullseye@debian:~$ /home/bullseye/test3/Python/2.7.3/ensurepip/Python-2.7.3/python --version
Python 2.7.3
bullseye@debian:~$

# test pip in Python 2.7.3 local
/home/bullseye/test3/Python/2.7.3/ensurepip/Python-2.7.3/python -m pip --version
bullseye@debian:~$ /home/bullseye/test3/Python/2.7.3/ensurepip/Python-2.7.3/python -m pip --version
pip 9.0.3 from /usr/local/lib/python2.7/site-packages (python 2.7)
bullseye@debian:~$

###  install pywb using Python 2.7.3 local
/home/bullseye/test3/Python/2.7.3/ensurepip/Python-2.7.3/python -m pip install --target /home/bullseye/target/2.7.3 pywb
bullseye@debian:~$ ###  install pywb
/home/bullseye/test3/Python/2.7.3/ensurepip/Python-2.7.3/python -m pip install --target /home/bullseye/target/2.7.3 pywb
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

# test by getting version.  Python 2.7.15 local
/home/bullseye/test3/Python/2.7.15/ensurepip/Python-2.7.15/python --version
bullseye@debian:~$ /home/bullseye/test3/Python/2.7.15/ensurepip/Python-2.7.15/python --version
Python 2.7.15
bullseye@debian:~$ 

# test pip in Python 2.7.15 local
/home/bullseye/test3/Python/2.7.15/ensurepip/Python-2.7.15/python -m pip --version
bullseye@debian:~$ /home/bullseye/test3/Python/2.7.15/ensurepip/Python-2.7.15/python -m pip --version
pip 9.0.3 from /usr/local/lib/python2.7/site-packages (python 2.7)
bullseye@debian:~$

###  install pywb using Python 2.7.15 local
/home/bullseye/test3/Python/2.7.15/ensurepip/Python-2.7.15/python -m pip install --target /home/bullseye/target/2.7.15 pywb
bullseye@debian:~$ /home/bullseye/test3/Python/2.7.15/ensurepip/Python-2.7.15/python -m pip install --target /home/bullseye/target/2.7.15 pywb
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

###  install pywb using Python 3.10.6 local
/home/bullseye/test/Python/3.10.6/ensurepip/Python-3.10.6/python -m pip install --target /home/bullseye/target/3.10.6 pywb
bullseye@debian:~$ /home/bullseye/test/Python/3.10.6/ensurepip/Python-3.10.6/python -m pip install --target /home/bullseye/target/3.10.6 pywb
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

# install pywb using pip global
pip install pywb
bullseye@debian:~$ pywb
[Errno 2] No such file or directory: './config.yaml'
2022-08-22 16:58:03,761: [INFO]: Starting Gevent Server on 8080

# install pywb using pip global
pip install --target /home/bullseye/target pywb
bullseye@debian:~$ /home/bullseye/target/bin/pywb
[Errno 2] No such file or directory: './config.yaml'
2022-08-22 16:32:02,421: [INFO]: Starting Gevent Server on 8080

# test by getting version.  Python 3.9.2 global
python3 --version
bullseye@debian:~$ python3 --version
Python 3.9.2
bullseye@debian:~$ 

###  install pywb using Python 3 and pip3 global
python3 -m venv myenvname
source myenvname/bin/activate
pip3 install pywb
bullseye@debian:~$ /home/bullseye/myenvname/bin/pywb
[Errno 2] No such file or directory: './config.yaml'
2022-08-22 16:56:47,893: [INFO]: Starting Gevent Server on 8080

# test pip in python global
python -m pip --version
bullseye@debian:~$ python -m pip --version
/usr/bin/python: No module named pip
bullseye@debian:~$ 

# test pip in python 3 global
python3 -m pip --version
bullseye@debian:~$ python3 -m pip --version
pip 22.2.2 from /home/bullseye/.local/lib/python3.9/site-packages/pip (python 3.9)
bullseye@debian:~$ 

# test python global
python --version
bullseye@debian:~$ python --version
Python 2.7.18
bullseye@debian:~$

# test pip global
pip --version
bullseye@debian:~$ pip --version
pip 22.2.2 from /home/bullseye/.local/lib/python3.9/site-packages/pip (python 3.9)
bullseye@debian:~$ 

# test pip 3 global
pip3 --version
bullseye@debian:~$ pip3 --version
bash: /home/bullseye/.local/bin/pip3: /usr/local/bin/python: bad interpreter: No such file or directory
bullseye@debian:~$

# try to add pip to python global
python -m ensurepip --upgrade
bullseye@debian:~$ python -m ensurepip --upgrade
ensurepip is disabled in Debian/Ubuntu for the system python.
Python modules For the system python are usually handled by dpkg and apt-get.
    apt-get install python-<module name>
Install the python-pip package to use pip itself.  Using pip together
with the system python might have unexpected results for any system installed
module, so use it on your own risk, or make sure to only use it in virtual
environments.
bullseye@debian:~$
 

Cromewell

Administrator
Staff member
Thank you Cromewell. I ran this several ways and always get the same error and then terminal freezes.
bullseye@debian:~$ pywb
[Errno 2] No such file or directory: './config.yaml'
2022-08-22 16:58:03,761: [INFO]: Starting Gevent Server on 8080

bullseye@debian:~$ ls ./config.yaml
ls: cannot access './config.yaml': No such file or directory
bullseye@debian:~$
There are a few setup steps I think you need to do first. The docs for how to do it are here: https://pywb.readthedocs.io/en/latest/manual/usage.html
 

b1bb2

New Member
It looked like the terminal froze so I figured something was wrong and I did not bother to procede with instructions and open localhost:8080 in my browser. Yes I have been following along with the install instructions but since the terminal froze I figured it made no sense to continue with operating instructions. I see that the install was successful. Page says Pywb Wayback Machine This archive contains the following collections:. Now I can continue from install and learn the next steps. PROBLEM SOLVED.
 

Okedokey

Well-Known Member
Again, what dev environment are you using? This kind of thing should be completely unnecessary pain in a good IDE.
 

b1bb2

New Member
Thank you Okedokey for offering more help. Sorry for not answering earlier, I figured answer was not needed after solution was made. I know little about dev environment and IDE, I do not think I use either. I simply try to follow instructions and insert code into terminal. I think the problem was that I did not understand pip. Here is where I am at now in learning to use pywb, everything looks good. Instructions say the recorded url will be accessible for replay, eg: http://localhost:8080/my-web-archive/http://example.com/ I have not read the next steps yet, Here is the replay:

Example Domain
This domain is for use in illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission.
 

Okedokey

Well-Known Member
Download VS Community, install it and the python workload (included).

After it installs, open VS Studio, and 'Open without code'
Go to Extensions, Manage Extensions and Search for python
Install CodeRunner
Close VS Studio as this allows it to install.

With VS Studio closed, navigate to your project FOLDER and right-click on any open space (not a file) and choose Open with VS Studio.
If you're on Windows 10/11, simply type winget upgrade --all in powershell to get everything updated automatically.
 

Okedokey

Well-Known Member
line 45
2022-08-22 16:58:03,761: [INFO]: Starting Gevent Server on 8080
^
SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers
 

Cromewell

Administrator
Staff member
line 45
2022-08-22 16:58:03,761: [INFO]: Starting Gevent Server on 8080
^
SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers
Are you loading that line in as code? It is logging output to the terminal you get when you start pywb up, not code that is expected to run.
 
Top