agude / wayback-machine-archiver

A Python script to submit web pages to the Wayback Machine for archiving.
https://pypi.org/project/wayback-machine-archiver/
MIT License
71 stars 11 forks source link

Issues in updating #20

Closed Melonadev closed 4 years ago

Melonadev commented 4 years ago

Is there a parameter for updating archiver? Like a --update or something.

_Originally posted by @Melonadev in https://github.com/agude/wayback-machine-archiver/issue_comments/711156395_

I'm using the latest version of pip (20.2.4), and I'm still having troubles with reinstalling archiver:

C:\Users\yewhe>pip install wayback-machine-archiver
Collecting wayback-machine-archiver
  Using cached wayback_machine_archiver-1.9.0-py3-none-any.whl (7.1 kB)
Collecting requests
  Using cached requests-2.24.0-py2.py3-none-any.whl (61 kB)
Collecting idna<3,>=2.5
  Using cached idna-2.10-py2.py3-none-any.whl (58 kB)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\python38\lib\site-packages (from requests->wayback-machine-archiver) (1.25.10)
Collecting certifi>=2017.4.17
  Using cached certifi-2020.6.20-py2.py3-none-any.whl (156 kB)
Requirement already satisfied: chardet<4,>=3.0.2 in c:\python38\lib\site-packages (from requests->wayback-machine-archiver) (3.0.4)
Installing collected packages: idna, certifi, requests, wayback-machine-archiver
  WARNING: Failed to write executable - trying to use .deleteme logic
ERROR: Could not install packages due to an EnvironmentError: [WinError 2] The system cannot find the file specified: 'c:\\python38\\Scripts\\archiver.exe' -> 'c:\\python38\\Scripts\\archiver.exe.deleteme'
agude commented 4 years ago

Hi @Melonadev!

This isn't a bug with Archiver, but I'm happy to try to help.

Permissions Issue

The problem you're having is a filesystem permissions issue. pip is being run by your user account but is trying to write to a location that only an administrator can write to.

You have two options:

  1. Run pip install --user wayback-machine-archiver. This will install the packages to your user directory instead of the system directory, so only you will be able to use them, but you don't need administrator privileges.
  2. Run pip install wayback-machine-archiver but from an administrator shell/terminal. This will install it for everyone, and since you're the admin you can install to the system directory instead of your user directory. The DOWNSIDE of this method is that you might have some issues running the script as your normal user. I suggest going with the 1. option above.

Other Notes

Since you have already installed Archiver, you should be able to run pip with --upgrade, which upgrades an already installed package. Something like pip install --upgrade --user wayback-machine-archiver.

Let me know how it goes!

Melonadev commented 4 years ago

EDIT: This method didn't work for me. Just delete and reinstall archiver instead.

I ran the last option and it works. Thanks!. C:\Users\yewhe>pip install --upgrade --user wayback-machine-archiver Requirement already up-to-date: wayback-machine-archiver in c:\python38\lib\site-packages (1.9.0) Requirement already satisfied, skipping upgrade: requests in c:\python38\lib\site-packages (from wayback-machine-archiver) (2.24.0) Requirement already satisfied, skipping upgrade: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\python38\lib\site-packages (from requests->wayback-machine-archiver) (1.25.10) Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in c:\python38\lib\site-packages (from requests->wayback-machine-archiver) (2020.6.20) Requirement already satisfied, skipping upgrade: idna<3,>=2.5 in c:\python38\lib\site-packages (from requests->wayback-machine-archiver) (2.10) Requirement already satisfied, skipping upgrade: chardet<4,>=3.0.2 in c:\python38\lib\site-packages (from requests->wayback-machine-archiver) (3.0.4)

agude commented 4 years ago

Awesome!

Melonadev commented 4 years ago

For some reason, after I tried updating, the archiver version is still 1.8.1.

Since you have already installed Archiver, you should be able to run pip with --upgrade, which upgrades an already installed package. Something like pip install --upgrade --user wayback-machine-archiver.

Melonadev commented 4 years ago

I uninstalled it: pip uninstall wayback-machine-archiver

C:\Users\yewhe>pip uninstall wayback-machine-archiver
Found existing installation: wayback-machine-archiver 1.9.0
Uninstalling wayback-machine-archiver-1.9.0:
  Would remove:
    c:\users\yewhe\appdata\roaming\python\python38\scripts\archiver.exe
    c:\users\yewhe\appdata\roaming\python\python38\site-packages\wayback_machine_archiver-1.9.0.dist-info\*
    c:\users\yewhe\appdata\roaming\python\python38\site-packages\wayback_machine_archiver\*
Proceed (y/n)? y
  Successfully uninstalled wayback-machine-archiver-1.9.0

...and reinstalled it: pip install wayback-machine-archiver --user

C:\Users\yewhe>pip install wayback-machine-archiver --user
Collecting wayback-machine-archiver
  Using cached wayback_machine_archiver-1.9.0-py3-none-any.whl (7.1 kB)
Requirement already satisfied: requests in c:\python38\lib\site-packages (from wayback-machine-archiver) (2.24.0)
Requirement already satisfied: certifi>=2017.4.17 in c:\python38\lib\site-packages (from requests->wayback-machine-archiver) (2020.6.20)
Requirement already satisfied: idna<3,>=2.5 in c:\python38\lib\site-packages (from requests->wayback-machine-archiver) (2.10)
Requirement already satisfied: chardet<4,>=3.0.2 in c:\python38\lib\site-packages (from requests->wayback-machine-archiver) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\python38\lib\site-packages (from requests->wayback-machine-archiver) (1.25.10)
Installing collected packages: wayback-machine-archiver
  WARNING: The script archiver.exe is installed in 'C:\Users\yewhe\AppData\Roaming\Python\Python38\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed wayback-machine-archiver-1.9.0

And now it's finally on the latest version:

C:\Users\yewhe>archiver --version
archiver 1.9.0