1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

pip install のデフォルト参照リポジトリを変更

Posted at

デフォルトのリポジトリの変更が意外と見つからないので備忘録として。
設定はCentOSです。
Windowsは分かりません。。。

UPLOAD SETUP

$ > vim ~/.pypirc

下記設定を入れます。

[distutils]
index-servers = pypi
                xxxx <= Myリポジトリ
[xxxx] <= Myリポジトリ
repository: http://xxxxxx <= 閉鎖環境ならhttpで十分
username: xxxx
password: xxxx

DOWNLOAD SETUP

$ > mkdir ~/.pip
$ > vim ~/.pip/pip.conf

下記設定を入れます。
なおrootで行えばsudo pip installが使えます。
ユーザー権限で行えばCoderVSCodeなどinstallする際に使えます。

[global]
index-url: YourURL
trusted-host: IP or domain

trusted-hostを設定することでhttpのエラーが出なくなります。
後は普通にpip installが使えます。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?