LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-13-2022, 01:45 PM   #1
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Rep: Reputation: Disabled
Python2, pip, setuptools, pywb


My ultimate goal is to run pywb. Along the way, I can not get Python2 to run pip and setuptools. pywb says the uWSGI container is recommended. OK, I have it. Now what should I do with it? Python 3.10.6 wants OpenSSL. How can I link them? Python 3.10.6 executable should be named python3. It is named python. How to fix this? My prefered method is to download source code, compile it, run local instance. See attached file test0812.pdf for details. I call it bash script. Is there a better name? What language is it writen in?
 
Old 08-14-2022, 01:57 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
would be nice to explain it better, I just don't understand what is it all about.
You mentioned both python2 and python3. pywb can be installed easily: https://pypi.org/project/pywb/
What OS do you have, what python and environment do you have? (would be nice to give us exact details, like output of relevant commands). Also there is no file attached.
 
Old 08-14-2022, 03:42 AM   #3
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Original Poster
Rep: Reputation: Disabled
You say pywb can be installed easily. Please tell me more. I and assistant have been working on it for several weeks. pypi.org is used in test0812.pdf. I tried both both python2 and python3. My System is debian 11.3 (Bullseye) Local Personal Computer. My assistant uses Debian VM on VirtualBox Local Personal Computer. This discussion only considers my system. Several local versions of python are installed, 3.10.6 is the only one that has pip and setuptools. Exact details, like output of relevant commands are in the file I attached. I saw no errors when I attached the file, but I agree I do not see it here. I now try uploading it again, directly in this post, using the code method. I reciently concluded the openssl problem is highly dependant on the system used. Note that test0812.pdf has detailed notes for nine seporate packages. They are all related to making pywb work. Help with any of these will be apreciated.

Code:
test0812.txt  2022 08 13  This bash script tests some software packages. System is debian 11.3 (Bullseye).  Local Personal Computer.

#### start openssl 3.1.0  plain  ####

# need because: Python 3.10.6 requires a OpenSSL 1.1.1 or newer

# download
mkdir -p /home/bullseye/test/openssl/3.1.0/plain
cd /home/bullseye/test/openssl/3.1.0/plain
wget https://github.com/openssl/openssl/archive/refs/heads/master.zip

# extract
cd /home/bullseye/test/openssl/3.1.0/plain
unzip master.zip

# read documentation
nano /home/bullseye/test/openssl/3.1.0/plain/openssl-master/INSTALL.md

# Build OpenSSL
cd /home/bullseye/test/openssl/3.1.0/plain/openssl-master/
./Configure
make

# rebuild the ldconfig cache. update the library paths.
sudo apt-get install glibc-source 
sudo ldconfig

# test by getting version. OpenSSL 1.1.1n  15 Mar 2022. If error, see footnote.
/home/bullseye/test/openssl/3.1.0/plain/openssl-master/apps/openssl version

#### end openssl 3.1.0  plain  ####

#### start Python 2.7.3  plain  ####

# need because: pywb Installation requires python

# download python 2.7.3 archive
mkdir -p /home/bullseye/test/Python/2.7.3/plain
cd /home/bullseye/test/Python/2.7.3/plain
wget https://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz

# list the archive.
ls /home/bullseye/test/Python/2.7.3/plain/Python-2.7.3.tgz

# extract python 2.7.3 archive
cd /home/bullseye/test/Python/2.7.3/plain
tar -xvf Python-2.7.3.tgz

# read documentation
nano /home/bullseye/test/Python/2.7.3/plain/Python-2.7.3/README

# build python 2.7.3
cd /home/bullseye/test/Python/2.7.3/plain/Python-2.7.3
./configure
make

# test by getting version.  Python 2.7.3
/home/bullseye/test/Python/2.7.3/plain/Python-2.7.3/python --version

#### end Python 2.7.3  plain  ####

#### start Python 2.7.3  with-ensurepip ####

# need because: pywb Installation requires python. install setuptools requires pip.

# download python 2.7.3 archive
mkdir -p /home/bullseye/test/Python/2.7.3/ensurepip
cd /home/bullseye/test/Python/2.7.3/ensurepip
wget https://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz

# list the archive.
ls /home/bullseye/test/Python/2.7.3/ensurepip/Python-2.7.3.tgz

# extract python 2.7.3 archive
cd /home/bullseye/test/Python/2.7.3/ensurepip
tar -xvf Python-2.7.3.tgz

# read documentation
nano /home/bullseye/test/Python/2.7.3/ensurepip/Python-2.7.3/README

# build python 2.7.3
cd /home/bullseye/test/Python/2.7.3/ensurepip/Python-2.7.3
./configure --with-ensurepip=install
make

# test by getting version.  Python 2.7.3
/home/bullseye/test/Python/2.7.3/ensurepip/Python-2.7.3/python --version

#### end Python 2.7.3 with-ensurepip ####

#### start Python 2.7.15  with-ensurepip  ####

# need because: pywb Installation requires python. a version of Python lower than 2.7.15 will fail on all DreamHost servers. install setuptools requires pip.

# download python 2.7.15 archive
mkdir -p /home/bullseye/test/Python/2.7.15/ensurepip
cd /home/bullseye/test/Python/2.7.15/ensurepip
wget https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz

# list the archive.
ls /home/bullseye/test/Python/2.7.15/ensurepip/Python-2.7.15.tgz

# extract python 2.7.15 archive
cd /home/bullseye/test/Python/2.7.15/ensurepip
tar -xvf Python-2.7.15.tgz

# read documentation
nano /home/bullseye/test/Python/2.7.15/ensurepip/Python-2.7.15/README

# build python 2.7.15
cd /home/bullseye/test/Python/2.7.15/ensurepip/Python-2.7.15
./configure --with-ensurepip=install
make

# test by getting version.  Python 2.7.15
/home/bullseye/test/Python/2.7.15/ensurepip/Python-2.7.15/python --version

#### end Python 2.7.15  with-ensurepip  ####

#### start Python 3.10.6  plain ####

# need because: pywb Installation requires python
# Python requires a OpenSSL 1.1.1 or newer

# download Python 3.10.6 source code archive.  Release Date: Aug. 2, 2022
mkdir -p /home/bullseye/test/Python/3.10.6/plain
cd /home/bullseye/test/Python/3.10.6/plain
wget https://www.python.org/ftp/python/3.10.6/Python-3.10.6.tar.xz

# list the archive.
ls /home/bullseye/test/Python/3.10.6/plain/Python-3.10.6.tar.xz

# extract python 3.10.6 archive
cd /home/bullseye/test/Python/3.10.6/plain
tar -xvf Python-3.10.6.tar.xz

# read documentation
nano /home/bullseye/test/Python/3.10.6/plain/Python-3.10.6/README.rst

# Build Python 3.10.6.  install Python as ``python3``.
cd /home/bullseye/test/Python/3.10.6/plain/Python-3.10.6
./configure
make

# test
/home/bullseye/test/Python/3.10.6/plain/Python-3.10.6/python --version

# install pip and setuptools
/home/bullseye/test/Python/3.10.6/plain/Python-3.10.6/python -m ensurepip --upgrade
# Defaulting to user installation because normal site-packages is not writeable
# Successfully installed pip-22.2.1 setuptools-63.2.0

# test pip
/home/bullseye/test/Python/3.10.6/plain/Python-3.10.6/python -m pip --version
# pip 22.2.1 from /home/bullseye/.local/lib/python3.10/site-packages/pip (python 3.10)

#### end Python 3.10.6 plain  ####

#### start setuptools 64.0.0  plain ####

# need because: pywb Installation requires setuptools.

# manually download setuptools Source Distribution archive.
firefox https://pypi.org/project/setuptools/#files Download files
Source Distribution setuptools-64.0.0.tar.gz

# list setuptools archive.
ls /home/bullseye/Downloads/setuptools-64.0.0.tar.gz

# copy setuptools
mkdir -p /home/bullseye/test/setuptools/64.0.0/plain
cp Downloads/setuptools-64.0.0.tar.gz /home/bullseye/test/setuptools/64.0.0/plain

# list setuptools archive.
ls /home/bullseye/test/setuptools/64.0.0/plain/setuptools-64.0.0.tar.gz

# extract setuptools Source Distribution archive
cd /home/bullseye/test/setuptools/64.0.0/plain
tar -xvf setuptools-64.0.0.tar.gz

# read setuptools documentation
nano /home/bullseye/test/setuptools/64.0.0/plain/setuptools-64.0.0/docs/userguide/quickstart.rst

# install setuptools  ???
pip install --upgrade setuptools

# read setuptools documentation
nano /home/bullseye/test/setuptools/64.0.0/plain/setuptools-64.0.0/README.rst

#### end setuptools 64.0.0 plain  ####

#### start uWSGI 2.0.20 plain  ####

# need because: pywb says the *uWSGI* container is recommended.

# download uWSGI archive.
mkdir -p /home/bullseye/test/uwsgi/2.0.20/plain
cd /home/bullseye/test/uwsgi/2.0.20/plain
wget https://projects.unbit.it/downloads/uwsgi-2.0.20.tar.gz

# list uWSGI archive.
ls /home/bullseye/Downloads/uwsgi-2.0.20.tar.gz

# extract uWSGI Source Distribution archive
cd /home/bullseye/test/uwsgi/2.0.20/plain
tar -xvf uwsgi-2.0.20.tar.gz

# read uWSGI documentation
nano /home/bullseye/test/uwsgi/2.0.20/plain/uwsgi-2.0.20/README

# install infrastructure needed to build uWSGI
apt-get install build-essential python
apt-get install python-dev

# build uWSGI
cd /home/bullseye/test/uwsgi/2.0.20/plain/uwsgi-2.0.20
make

# launch uWSGI
/home/bullseye/test/uwsgi/2.0.20/plain/uwsgi-2.0.20/uwsgi

!!! no internal routing support, rebuild with pcre support !!!
*** WARNING: you are running uWSGI without its master process manager ***
thunder lock: disabled (you can enable it with --thunder-lock)
The -s/--socket option is missing and stdin is not a socket.

#### end uWSGI 2.0.20  plain  ####

#### start pywb 2.6.7  plain ####

# need because: ultimate goal.
# pywb Installation requires python and setuptools.

# 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

# try install with Python 2.7.3
/home/bullseye/test/pywb/2.6.7/plain/Python-2.7.3/python /home/bullseye/test/pywb/2.6.7/plain/pywb-v-2.6.7/setup.py
# ImportError: No module named setuptools

# try install with Python 3.10.6, which has pip and setuptools.
/home/bullseye/test/Python/3.10.6/plain/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

#### end pywb 2.6.7  ####

#### start uwsgi-docs-master ####

# need because: documentation is helpful.

# download uWSGI archive.
mkdir -p /home/bullseye/test/uwsgi/docs-master
cd /home/bullseye/test/uwsgi/docs-master
wget https://projects.unbit.it/downloads/

# list uWSGI archive.
ls /home/bullseye/Downloads/

# extract uwsgi-docs-master.zip
cd /home/bullseye/test/uwsgi/docs-master
unzip uwsgi-docs-master.zip

# read uwsgi-docs-master.zip uWSGI documentation
nano /home/bullseye/test/uwsgi/docs-master/uwsgi-docs-master/Install.rst

#### end uwsgi-docs-master ####

# list everything
ls -1 /home/bullseye/test

# print this file
sudo apt-get install enscript ghostscript
enscript -p test0812.ps test0812.txt
ps2pdf test0812.ps test0812.pdf

# copy this file
mkdir -p /home/bullseye/test/method
cp /home/bullseye/test0812.txt /home/bullseye/test/method
cp /home/bullseye/test0812.pdf /home/bullseye/test/method

xxxxxxxxxxxxxxxxx

footnote for openssl 3.1.0  plain.  If needed try this:
error while loading shared libraries: libssl.so.3: cannot open shared object file: No such file or directory
error while loading shared libraries: libssl.so.3: cannot open shared object file: No such file or directory
ldconfig /usr/local/lib64/
rebuild the ldconfig cache. update the library paths.
sudo ldconfig
sudo nano /etc/ld.so.conf.d/openssl.conf
/usr/local/ssl/lib64
sudo apt-get install libssl1.0.0 libssl-dev
sudo ln -s libssl.so.1.0.0 libssl.so.10
sudo ln -s libcrypto.so.1.0.0 libcrypto.so.10
sudo ln -s /usr/local/lib64/libssl.so.3 /usr/lib64/libssl.so.3
sudo ln -s /usr/local/lib64/libcrypto.so.3 /usr/lib64/libcrypto.so.3
ldconfig /usr/local/lib64/
update the library paths
$ sudo ldconfig
sudo touch /etc/ld.so.conf.d/lib.conf
# edit ld.conf file 
# add a line containing `/usr/local/lib64`
$ sudo nano /etc/ld.so.conf.d/lib.conf

xxxxxxxxxxx

# questions

documentation says executable filename python3 should be used. How to get it?
/home/bullseye/test/Python/3.10.6/plain/Python-3.10.6/python3 --version
No such file or directory.

have downloaded software package that work: openssl, setuptools, uwsgi. How to apply them?

xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
Old 08-14-2022, 08:14 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
again, I can't find any attached file.
https://computingforgeeks.com/how-to...p-3-on-debian/ should work on debian and will install pip and setuptools
 
Old 08-14-2022, 09:39 AM   #5
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,137
Blog Entries: 6

Rep: Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826
@OP you could have given more info, so that someone would know what you are talking about.

Here is the source.
https://github.com/webrecorder/pywb
https://pywb.readthedocs.io/en/latest/
https://github.com/webrecorder/pywb/...in/INSTALL.rst
https://pywb.readthedocs.io/en/lates...etting-started

Quote:
pywb is a Python (2 and 3) web archiving toolkit for replaying web archives large and small as accurately as possible. The toolkit now also includes new features for creating high-fidelity web archives.
Python2 has been deprecated for a good while. Some distros don't even have it in the repos anymore.

Do you have python2 and friends in your repos? If not then you'll have to build it/them. (I would not. If it isn't for python 3, then forget it. Use something else.)

Do you have python3 in your repos? You should. Python3 is supported by just about everything.

I haven't looked at that source too much. But it's python, so get the source, unzip it into an empty directory, and work on it. You can't hurt anything that way.

You should have openssl in your repo. If not, that would be strange. Since everything uses it.

If you can install python modules from your repo, instead of using pip, your package manager will be happy. (No broken python file tree), when you update with your package manager.

https://www.python.org/
https://www.openssl.org
 
Old 08-14-2022, 09:46 PM   #6
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Original Poster
Rep: Reputation: Disabled
Here is third attempt to upload test0812.pdf.

To: pan64, LQ Addict
But I gave you test0812.pdf in my previous code block. As you seem to want the attached version, I try now to upload it again. Is this code block correct?
Code:
post reply> additional options> attach files> manage attachments> upload from your computer> browse> upload>
Current Attachments (17.8 KB)
pdf.gif test0812.pdf (17.8 KB)
close this window>
To: teckk, Senior Member
Yes I could have given more info, but attachment test0812.pdf already had that info so I figured giving it again would be redundant. Sorry.

Thank you for the source, but I have already put the source in test0812.pdf. test0812.pdf includes Python2 and Python3 from source and that compile is successful. Same with openssl.

Yes I have python3 in my repo. And I might have python2 in my repo. But I am trying to use local instance from source. Will that not work? I do not know about my friend.

Instructions for pywb are confusing. That is why I try both versions of python, hoping one will work.

I think me and test0812.pdf has explained better and answered all your questions. If not, please ask again.
Attached Files
File Type: pdf test0812.pdf (17.8 KB, 7 views)
 
Old 08-15-2022, 01:11 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
ok, sorry, I did not recognize the [code] block is the attached pdf.
Anyway, why do you want to rebuild python, you can simply install it from repo (as far as I know both 2.7 and 3.10)?
building python is not that trivial and installing it from repo is much easier.

I guess python is by default installed, so in your case there were two different python3 (and python2) available and I think you mixed them (that means sometimes you used your own one, but sometimes the other, official version). That makes it difficult to follow. Also you installed python-dev, but you ought to use your own python dev environment (once you have already created it).
Also (probably) you need to adjust your PATH to use your own python (and also your own site-packages), but that may introduce instability (because the system needs the official one).

Probably I would try to do it in a docker container.
 
Old 08-15-2022, 07:08 AM   #8
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Original Poster
Rep: Reputation: Disabled
To: pan64, LQ Addict

I disagree with many things you said and I am ready to argue my case. We can do that if you wish. As you can see in test0812.pdf, I prefer to compile source code and link local instance. This is what I am used to. If needed I can try other methods. For now let us proceed to fix some problems. All my local python installations return correct version when asked. I guess this means they should pass any other test? No problem here with python install.

I have local instance of OpenSSL working on my system. How to use it, where to link it to?

I extracted setuptools Source Distribution archive. Now how to use it?

I have local instance of Python 2.7.15 compiled with ensurepip. How can I use the ensurepip?
/home/bullseye/test/Python/2.7.15/ensurepip/Python-2.7.15/python -m pip --version
No module named pip

/home/bullseye/test/Python/3.10.6/plain/Python-3.10.6/python -m ensurepip --upgrade
# Successfully installed pip-22.2.1 setuptools-63.2.0
Great. But I would like to use my local instance of setuptools. How to?

How to use this? How to fix the errors?
# launch uWSGI
/home/bullseye/test/uwsgi/2.0.20/plain/uwsgi-2.0.20/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
*** WARNING: you are running uWSGI without its master process manager ***
thunder lock: disabled (you can enable it with --thunder-lock)
The -s/--socket option is missing and stdin is not a socket.

pywb 2.6.7 How to fix this error? It is very strange.
# try install with Python 3.10.6, which has pip and setuptools.
/home/bullseye/test/Python/3.10.6/plain/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

documentation says executable filename python3 should be used. How to get it? Source code compiles executable filename to python. Should I simply rename?
 
Old 08-15-2022, 06:27 PM   #9
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Original Poster
Rep: Reputation: Disabled
Here is a progress report.

I found the command to use the ensurepip module.
/home/bullseye/test/Python/2.7.15/ensurepip/Python-2.7.15/python -m ensurepip
What now?
Code:
bullseye@debian:~$ /home/bullseye/test/Python/2.7.15/ensurepip/Python-2.7.15/python -m ensurepip
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Exception:
Traceback (most recent call last):
  File "/tmp/tmprhvIqc/pip-9.0.3-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/tmp/tmprhvIqc/pip-9.0.3-py2.py3-none-any.whl/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/tmp/tmprhvIqc/pip-9.0.3-py2.py3-none-any.whl/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/tmp/tmprhvIqc/pip-9.0.3-py2.py3-none-any.whl/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/tmp/tmprhvIqc/pip-9.0.3-py2.py3-none-any.whl/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/tmp/tmprhvIqc/pip-9.0.3-py2.py3-none-any.whl/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/tmp/tmprhvIqc/pip-9.0.3-py2.py3-none-any.whl/pip/wheel.py", line 323, in clobber
    shutil.copyfile(srcfile, destfile)
  File "/home/bullseye/test/Python/2.7.15/ensurepip/Python-2.7.15/Lib/shutil.py", line 97, in copyfile
    with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/easy_install.py'
bullseye@debian:~$

for uWSGI error, Internet search says to do this.
Code:
pip uninstall uwsgi
sudo apt-get install libpcre3 libpcre3-dev
pip install uwsgi
for uWSGI error, No change, same error message.
Code:
bullseye@debian:~$ /home/bullseye/test/uwsgi/2.0.20/plain/uwsgi-2.0.20/uwsgi
*** Starting uWSGI 2.0.20 (64bit) on [Mon Aug 15 15:22:01 2022] ***
compiled with version: 10.2.1 20210110 on 12 August 2022 20:59:10
os: Linux-5.10.0-16-amd64 #1 SMP Debian 5.10.127-2 (2022-07-23)
nodename: debian
machine: x86_64
clock source: unix
detected number of CPU cores: 4
current working directory: /home/bullseye
detected binary path: /home/bullseye/test/uwsgi/2.0.20/plain/uwsgi-2.0.20/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 61606
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
The -s/--socket option is missing and stdin is not a socket.
bullseye@debian:~$


to fix error from pywb: navigate to the correct folder and then run the command git init, which will create a new empty Git repository. initialize a repo in the directory where you want to place the repo: git init. Git will look for a .git repository directory (inside of the project root?)
git init
Initialized empty Git repository in /home/bullseye/.git/

bullseye@debian:~$ /home/bullseye/test/Python/3.10.6/plain/Python-3.10.6/python /home/bullseye/test/pywb/2.6.7/plain/pywb-v-2.6.7/setup.py install
fatal: Needed a single revision

Good. error message changed. Now study git.
 
Old 08-16-2022, 12:49 AM   #10
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
Quote:
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/easy_install.py'
You must execute that command as root, regular user has no right to put anything into that dir. Or you need to use pip as user, not as root.
the missing git repo means you need to put a real git repo containing some files, data, whatever. git init and an empty repo will be definitely insufficient, but you need to find out which repo is missing. Also running git init in your home is not a good idea.
 
Old 08-16-2022, 02:43 AM   #11
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Original Poster
Rep: Reputation: Disabled
Thank you pan64, LQ Addict. Another problem fixed.

# run the python module ensurepip use sudo
sudo /home/bullseye/test/Python/2.7.15/ensurepip/Python-2.7.15/python -m ensurepip
bullseye@debian:~$ sudo /home/bullseye/test/Python/2.7.15/ensurepip/Python-2.7.15/python -m ensurepip
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Successfully installed pip-9.0.3 setuptools-39.0.1
bullseye@debian:~$

# test pip
/home/bullseye/test/Python/2.7.15/ensurepip/Python-2.7.15/python -m pip --version
bullseye@debian:~$ /home/bullseye/test/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:~$
 
Old 08-16-2022, 08:42 PM   #12
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Original Poster
Rep: Reputation: Disabled
I used system to delete .git folder. Or is there a special way to delete? Now put git in proper place. No problem here.
Code:
cd /home/bullseye/test/pywb/2.6.7/plain/pywb-v-2.6.7
git init
# Initialized empty Git repository in /home/bullseye/test/pywb/2.6.7/plain/pywb-v-2.6.7/.git/
git add .
git commit
# [master (root-commit) 3889c09] ok
# Committer: bullseye <bullseye@debian>
# try install pywb with Python 3.10.6, which has pip and setuptools. and now git.
/home/bullseye/test/Python/3.10.6/plain/Python-3.10.6/python /home/bullseye/test/pywb/2.6.7/plain/pywb-v-2.6.7/setup.py install
Code:
bullseye@debian:~$ /home/bullseye/test/Python/3.10.6/plain/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:~$
Same problem as in first try. I could retry with git folder in home, but pan64 said not to. What now?
 
Old 08-17-2022, 09:50 AM   #13
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,137
Blog Entries: 6

Rep: Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826
Quote:
What now?
Quote:
/home/bullseye/test/Python/3.10.6/plain/Python-3.10.6/python /home/bullseye/test/pywb/2.6.7/plain/pywb-v-2.6.7/setup.py
Seems that you don't understand python, the way that looks. You can't run a python2 script with python3. They are different. Python3 is not just an update to python2. Also, python2 is deprecated a couple of years ago. I've answered that. If you are going to run a python2 script, then you will need a working python2 environment. But python2 is done. Should have moved away from it 3 or 4 years ago.

If pywb is python2, then it needs a rewrite.

Plus, python changes every now and then with no respect for backwards compatibility. So, a python script written 6-8 years ago, may or may nor run today, on a more recent version of python. And I mean the same major version.

I think that you are going to run in circles until you:

1. Understand python. Being able to look at the source tree and understand it.

2. Have a working python environment for the python script major version that it was written to run in.

3. Are able to look at the source tree and edit any lines that are causing an error. You'll need to go to the python docs, and see what has changed lately.

4. Pip makes a mess for maintaining a python tree on a linux machine. Use your package manager, and install everything from your distos repo, that matches. If you need something that is not in repo, and must use pip to get it, don't run pip as root, and mess up your python file tree. Put that module into a directory in /home and run it from there. Then you won't overwrite your python tree with stuff that does not match and will cause errors.

The error that you are getting.
Quote:
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:
Quote:
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(),
#Line 14, Line 93
https://github.com/webrecorder/pywb/blob/main/setup.py

What is causing that error?

If you are going to build something outside of your package manager, then... you have to build it.
 
Old 08-17-2022, 01:34 PM   #14
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Original Poster
Rep: Reputation: Disabled
To: teckk, Senior Member
Distribution: Arch

Quote:
I've answered that.
Yes, much of this discussion is being repeated.
Quote:
Seems that you don't understand python
I agree.
Quote:
You can't run a python2 script with python3.
Depends on the script?
Quote:
Python3 is not just an update to python2.
I understand that.
Quote:
python2 is deprecated a couple of years ago.
More than a couple of years ago?
Quote:
If you are going to run a python2 script, then you will need a working python2 environment.
I do not know if pywb 2.6.7 is a python2 script or a a python3 script. That is why test0812.txt has both a working python2 environment and a working python3 environment.
Quote:
If pywb is python2, then it needs a rewrite.
README.rst says **pywb** is a Python (2 and 3) web archiving toolkit
Quote:
python changes every now and then with no respect for backwards compatibility.
That can be said for many hardware and software.
Quote:
Have a working python environment for the python script major version that it was written to run in.
test0812.txt does that.
Quote:
Put that module into a directory in /home and run it from there.
test0812.txt does that.
Quote:
If you are going to build something outside of your package manager, then... you have to build it.
test0812.txt does that.

It seems to me the problem is git. Here is the first error.
/home/bullseye/test/Python/3.10.6/plain/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

This changes the error.
git init
bullseye@debian:~$ /home/bullseye/test/Python/3.10.6/plain/Python-3.10.6/python /home/bullseye/test/pywb/2.6.7/plain/pywb-v-2.6.7/setup.py install
fatal: Needed a single revision

This goes back to the first error.
cd /home/bullseye/test/pywb/2.6.7/plain/pywb-v-2.6.7
git init
# Initialized empty Git repository in /home/bullseye/test/pywb/2.6.7/plain/pywb-v-2.6.7/.git/
git add .
git commit
# [master (root-commit) 3889c09] ok
# Committer: bullseye <bullseye@debian>
fatal: not a git repository (or any of the parent directories): .git

Quote:
run in circles
Well said.
 
Old 08-17-2022, 02:57 PM   #15
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
no, the problem is not git, but you. You just don't understand what are you doing, you mix things and have no idea how to fix those failures. It is ok, you don't have to know everything, that's why you need to use the official tools to install it instead of rebuilding.
python2 and python3 are two different things, they are not compatible with each other (yes, they almost the same, but practically we don't write scripts for both - yes, there can be exceptions). Anyway, python2 is also deprecated and should not be used (only if there is no any way to use python3).
You do not need a git repo there, but you need a given repo, which can be cloned from somewhere probably, but you cannot create it yourself. Therefore git init and your other git commits will not be able to solve that issue (missing repo).
It looks like you are not really familiar with pip and setuptools too, you don't really know what are the modules, so better to stop.

Go back to post #4, try to follow that and if that worked you can try to reproduce that yourself. But first just try to install it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Slackware current - Openssl and python2 update broke python-setuptools? orbea Slackware 28 03-14-2016 03:16 PM
[SOLVED] How can I make Python2.7 my default Python without deleting/removing python2.6. steves504 Linux - Server 2 03-21-2014 11:57 AM
how do I install pip/setuptools and other Python packages without sudo/su privileges? OMouse Linux - Software 2 08-30-2013 11:40 AM
[SOLVED] Trying to install 'Gmail Backup' but it requires python2.5 - I have python2.8... Robert.Thompson Slackware 6 05-10-2011 08:23 AM
Python2.5-devel is unable to find installed Python2.5 Setya SUSE / openSUSE 1 06-08-2007 01:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration