Create an environment for MkDocs on Amazon Linux (attempted)

I thought it would be nice if I could manage the operation procedure manual with MkDocs that I knew a little, so I started trying to build an environment easily.

**Caution! !! ** ** This article failed as a result, so please refer to this article for completion, and skip the following failure stories. .. .. (This is my memorandum)

Premise

Environmental preparation

This was done with reference to Automatically create document sites using MkDocs.

pip installation

Install Python package management pip. Follow the steps on the official website and do the following:

$ sudo wget https://bootstrap.pypa.io/get-pip.py
$ sudo python get-pip.py

Collecting pip
  Downloading pip-8.1.1-py2.py3-none-any.whl (1.2MB)
    100% |████████████████████████████████| 1.2MB 49kB/s 
Collecting wheel
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
    100% |████████████████████████████████| 71kB 290kB/s 
Installing collected packages: pip, wheel
  Found existing installation: pip 6.1.1
    Uninstalling pip-6.1.1:
      Successfully uninstalled pip-6.1.1
Successfully installed pip-8.1.1 wheel-0.29.0

Install mkdocs

$ sudo pip install mkdocs

~~ Omitted ~~

Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 732, in install
    **kwargs
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 835, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 1030, in move_wheel_files
    isolated=self.isolated,
  File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 344, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 315, in clobber
    ensure_dir(destdir)
  File "/usr/local/lib/python2.7/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/usr/lib64/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/markdown'

Recalling that pip wasn't up to date, I did the following:

$ pip install -U pip
Requirement already up-to-date: pip in /usr/local/lib/python2.7/site-packages

Maybe success. By the way, when I added sudo, I got an error ... I haven't checked this area because it's sparse. .. ..

$ sudo pip install -U pip
Traceback (most recent call last):
  File "/usr/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3020, in <module>
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 616, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 629, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 807, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==6.1.1

Hmm? Do you need sudo? Thinking about it, try running it without sudo.

$pip install mkdocs
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/markdown'

After all, the same error. .. .. Looking at the error part, it seems that there is no markdown, so try installing with pip.

$ pip install markdown
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/markdown'

And the same error. .. .. I notice here. Is there something wrong with the path?

$ ls -l /usr/local/lib/python2.7/site-packages
total 20
drwxr-xr-x 10 root root 4096 Apr  6 13:11 pip
drwxr-xr-x  2 root root 4096 Apr  6 13:11 pip-8.1.1.dist-info
-rw-r--r--  1 root root  119 Dec  9 03:25 README
drwxr-xr-x  5 root root 4096 Apr  6 13:11 wheel
drwxr-xr-x  2 root root 4096 Apr  6 13:11 wheel-0.29.0.dist-info
$ ls -l /usr/local/lib64/python2.7/site-packages/
total 4
-rw-r--r-- 1 root root 119 Dec  9 03:25 README

I think the path by sudo is strange. Forcibly reinstall pip once.

$ sudo python get-pip.py --force-reinstall
Collecting pip
  Using cached pip-8.1.1-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 8.1.1
    Uninstalling pip-8.1.1:
      Successfully uninstalled pip-8.1.1
Successfully installed pip-8.1.1
$ pip install mkdocs

~~ Omitted ~~

Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 732, in install
    **kwargs
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 835, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 1030, in move_wheel_files
    isolated=self.isolated,
  File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 344, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 315, in clobber
    ensure_dir(destdir)
  File "/usr/local/lib/python2.7/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/usr/lib64/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/markdown'

After all it's no good ... I broke my heart, so I stopped temporarily.

Summary

I'm frustrated, so I'll try again! !!

Recommended Posts

Create an environment for MkDocs on Amazon Linux (attempted)
I tried to create an environment of MkDocs on Amazon Linux
Build an LNPP environment on Amazon Linux 2
Create a Linux environment on Windows 10
Introduce Python 3.5.2 environment on Amazon Linux
Linux beginners create Ubuntu 16.04 environment on Docker (for Mac)-first half-
Create an AWS Cloud9 development environment on your Amazon EC2 instance
Create an OpenCV3 + python3 environment on OSX
Building an environment for "Tello_Video" on Raspbian
Building an environment for "Tello_Video" on Windows
Procedure for building a kube environment on amazon linux2 (aws) ~ (with bonus)
Building an environment for matplotlib + cartopy on Mac
Set up an Objective-C 2.0 development environment on Linux
Build an Arch Linux environment on Raspberry Pi
Creating an environment for OSS-DB Silver # 1_Create a Linux environment (CentOS7 virtual environment) with VirtualBox/Vagrant
Building an environment for "Tello_Video" on Mac OS X
[Linux] WSL2 Build an environment for laravel7 with Ubuntu 20.04
Create an OpenAI Gym environment with bash on Windows 10
Compile and install MySQL-python for python2.7 on amazon linux
How to build a Python environment on amazon linux 2
Cross development environment (developing programs for windows on linux)
How to prepare an environment with different python version and package for each project with pyenv-virtualenv on Amazon Linux
Create an environment for test automation with AirtestIDE (Tips)
How to create a Python 3.6.0 environment by putting pyenv on Amazon Linux and Ubuntu
Create an environment with virtualenv
Put jenv on Amazon Linux
Install tomcat 5.5 on Amazon Linux.
Use sshpass on Amazon linux2
Install Homebrew on Amazon Linux 2
Install strongSwan 5.9.1 on Amazon Linux 2
Linux environment construction (on WSL environment)
Install LAMP on Amazon Linux 2 and build a WordPress environment.
Build an environment for machine learning using Python on MacOSX
Create a VS Code + Docker development environment on a Linux VM
Create an environment for "Deep Learning from scratch" with Docker
How to create an ISO file (CD image) on Linux
Create a virtual environment for python on mac [Very easy]
How to set up WSL2 on Windows 10 and create a study environment for Linux commands
Create a Python environment for professionals in VS Code on Windows
Prepare pipenv environment with amazon Linux 2
Install Python Pillow on Amazon Linux
[MariaDB] Install MariaDB on Linux and create a DB and an operating user.
Install oracle java8 on amazon linux2
Build a Selenium environment on Amazon Linux 2 in the shortest time
Create a Python environment on Mac (2017/4)
Create Scratch Offline Editor for Linux
Install pyenv on EC2 (Amazon Linux)
Create a python environment on centos
[Linux] Docker environment construction on Redhat
Create an environment for Django x Apache x mod_wsgi with Vagrant (Ubuntu 16.04)
Create a Docker container image with JRE8 / JDK8 on Amazon Linux
[Note] Install Imagick on Amazon Linux2
Created an environment for Anaconda & Jupyter
[Note] Run Django on Amazon Linux 2
Run docker-compose on Amazon Linux2 on ARM64
pykintone on Windows Subsystem for Linux
Run cron on Amazon Linux (set on Linux)
A note for me that I can't add an external repository with rpm --import on Amazon Linux2
I easily built an operating environment for Python3 + Tornado on AWS EC2.
[Definitive Edition] Building an environment for learning "machine learning" using Python on Mac
Building a Python3 environment with Amazon Linux2