« Blenderで怪しい線が表示される Main MDN文書の翻訳 »

Pitでのログイン情報の管理(Python/Anaconda版)

ログイン情報管理のPitをPythonで使おうとしたら、Anaconda環境用のパッケージはないようだったので、PyPIのwhl形式でインストール

下記を参考:

手順のとおりにskeletonを作成しようとしたら、patchがないとエラーが出たので、まずはcondaでm2-patchをインストール。

(base) .>conda install m2-patch
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##
  environment location: .\Anaconda3
  added / updated specs:
    - m2-patch

The following packages will be downloaded:
    package                    |            build
    ---------------------------|-----------------
    m2-msys2-runtime-2.5.0.17080.65c939c|                3         3.0 MB
    m2-patch-2.7.5             |                2          89 KB
    spyder-kernels-0.5.2       |           py37_0          71 KB
    ------------------------------------------------------------
                                           Total:         3.1 MB

The following NEW packages will be INSTALLED:
  m2-msys2-runtime   pkgs/msys2/win-64::m2-msys2-runtime-2.5.0.17080.65c939c-3
  m2-patch           pkgs/msys2/win-64::m2-patch-2.7.5-2

The following packages will be UPDATED:
  openssl                                 1.1.1d-he774522_3 --> 1.1.1d-he774522_4

The following packages will be DOWNGRADED:
  spyder                                       4.0.1-py37_0 --> 3.3.6-py37_0
  spyder-kernels                               1.8.1-py37_0 --> 0.5.2-py37_0

Proceed ([y]/n)? y

Downloading and Extracting Packages
m2-msys2-runtime-2.5 | 3.0 MB    | ############################################################################ | 100%
spyder-kernels-0.5.2 | 71 KB     | ############################################################################ | 100%
m2-patch-2.7.5       | 89 KB     | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
 ...
done

見てたら、SpyderやらSpyder-kernelsやらがダウングレードされちゃってたが、しかたないか…。

引き続き、Pit用のskeleton作成。

(base) .>conda skeleton pypi pit
Warning, the following versions were found for pit
0.1
0.2
0.3
0.4
Using 0.4
Use --version to specify a different version.
Using url https://files.pythonhosted.org/packages/b6/66/c84ec75ff3a8ad561c404fd473a9f329fa7f56a802a9c3d2cea8399f8027/pit-0.4.tar.gz (2 KB) for pit.
Downloading pit
PyPI URL:  https://files.pythonhosted.org/packages/b6/66/c84ec75ff3a8ad561c404fd473a9f329fa7f56a802a9c3d2cea8399f8027/pit-0.4.tar.gz
Using cached download
Unpacking pit...
done
working in .\AppData\Local\Temp\tmp6pj22nm6conda_skeleton_pit-0.4.tar.gz
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done

## Package Plan ##
  environment location: .\Anaconda3\conda-bld\skeleton_1582266739069\_h_env

The following NEW packages will be INSTALLED:

    ca-certificates: 2020.1.1-0
    certifi:         2019.11.28-py37_0
    openssl:         1.1.1d-he774522_4
    pip:             20.0.2-py37_1
    python:          3.7.6-h60c2a47_2
    pyyaml:          5.3-py37he774522_0
    setuptools:      45.2.0-py37_0
    sqlite:          3.31.1-he774522_0
    vc:              14.1-h0510ff6_4
    vs2015_runtime:  14.16.27012-hf0eaf9b_1
    wheel:           0.34.2-py37_0
    wincertstore:    0.2-py37_0
    yaml:            0.1.7-hc54c509_2

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
Applying patch: '.\\AppData\\Local\\Temp\\tmp6pj22nm6conda_skeleton_pit-0.4.tar.gz\\pypi-distutils.patch'
Trying to apply patch as-is
INFO:conda_build.source:Trying to apply patch as-is
INFO conda_build.source:apply_patch(596): Trying to apply patch as-is
(Stripping trailing CRs from patch; use --binary to disable.)
patching file core.py
Hunk #1 succeeded at 167 with fuzz 2 (offset 1 line).
Writing recipe for pit
--dirty flag and --keep-old-work not specified. Removing build/test folder after successful build/test.

INFO:conda_build.config:--dirty flag and --keep-old-work not specified. Removing build/test folder after successful build/test.
INFO conda_build.config:__exit__(799): --dirty flag and --keep-old-work not specified. Removing build/test folder after successful build/test.

次にbuild。

(base) .>conda build pit
No numpy version specified in conda_build_config.yaml.  Falling back to default numpy value of 1.11
WARNING:conda_build.metadata:No numpy version specified in conda_build_config.yaml.  Falling back to default numpy value of 1.11
Adding in variants from internal_defaults
INFO:conda_build.variants:Adding in variants from internal_defaults
Attempting to finalize metadata for pit
INFO:conda_build.metadata:Attempting to finalize metadata for pit
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
BUILD START: ['pit-0.4-py37_0.tar.bz2']
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done

## Package Plan ##

  environment location: .\Anaconda3\conda-bld\pit_1582266822048\_h_env


The following NEW packages will be INSTALLED:

    ca-certificates: 2020.1.1-0
    certifi:         2019.11.28-py37_0
    openssl:         1.1.1d-he774522_4
    pip:             20.0.2-py37_1
    python:          3.7.6-h60c2a47_2
    pyyaml:          5.3-py37he774522_0
    setuptools:      45.2.0-py37_0
    sqlite:          3.31.1-he774522_0
    vc:              14.1-h0510ff6_4
    vs2015_runtime:  14.16.27012-hf0eaf9b_1
    wheel:           0.34.2-py37_0
    wincertstore:    0.2-py37_0
    yaml:            0.1.7-hc54c509_2

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
Successfully built pit
Installing collected packages: pit
  Created temporary directory: .\AppData\Local\Temp\pip-unpacked-wheel-wp9fw4u5
  ...
Successfully installed pit-0.4
Cleaning up...
  Removing source in .\AppData\Local\Temp\pip-req-build-saao9eu5
Removed build tracker: '.\\AppData\\Local\\Temp\\pip-req-tracker-itgpwm4s'

Resource usage statistics from building pit:
   Process count: 3
   CPU time: Sys=0:00:04.0, User=0:00:00.8
   Memory: 40.6M
   Disk usage: 0B
   Time elapsed: 0:00:18.5

Packaging pit
INFO:conda_build.build:Packaging pit
INFO conda_build.build:build(1570): Packaging pit
Packaging pit-0.4-py37_0
INFO:conda_build.build:Packaging pit-0.4-py37_0
INFO conda_build.build:bundle_conda(891): Packaging pit-0.4-py37_0
compiling .pyc files...
number of files: 7
Fixing permissions
Packaged license file/s.
WARNING: Detecting which files contain PREFIX is slow, installing ripgrep makes it faster. 'conda install ripgrep'
TEST START: .\Anaconda3\conda-bld\win-64\pit-0.4-py37_0.tar.bz2
Adding in variants from .\AppData\Local\Temp\tmp9rzftoi8\info\recipe\conda_build_config.yaml
INFO:conda_build.variants:Adding in variants from .\AppData\Local\Temp\tmp9rzftoi8\info\recipe\conda_build_config.yaml
INFO conda_build.variants:_combine_spec_dictionaries(188): Adding in variants from .\AppData\Local\Temp\tmp9rzftoi8\info\recipe\conda_build_config.yaml
Nothing to test for: .\Anaconda3\conda-bld\win-64\pit-0.4-py37_0.tar.bz2
Renaming work directory,  .\Anaconda3\conda-bld\pit_1582266822048\work  to  .\Anaconda3\conda-bld\pit_1582266822048\work_moved_pit-0.4-py37_0_win-64_main_build_loop
# Automatic uploading is disabled
# If you want to upload package(s) to anaconda.org later, type:

anaconda upload .\Anaconda3\conda-bld\win-64\pit-0.4-py37_0.tar.bz2

# To have conda build upload to anaconda.org automatically, use
# $ conda config --set anaconda_upload yes

anaconda_upload is not set.  Not uploading wheels: []
####################################################################################
Resource usage summary:

Total time: 0:01:36.8
CPU usage: sys=0:00:04.0, user=0:00:00.8
Maximum memory usage observed: 40.6M
Total disk usage observed (not including envs): 0B

####################################################################################
Source and build intermediates have been left in .\Anaconda3\conda-bld.
There are currently 3 accumulated.
To remove them, you can run the ```conda build purge``` command

で、インストール。

(base) .>conda install --use-local pit
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##
  environment location: .\Anaconda3
  added / updated specs:
    - pit

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    pit-0.4                    |           py37_0           8 KB  local
    ------------------------------------------------------------
                                           Total:           8 KB

The following NEW packages will be INSTALLED:
  pit                C:/Users/oshiro/Anaconda3/conda-bld/win-64::pit-0.4-py37_0

Proceed ([y]/n)? y

Downloading and Extracting Packages
pit-0.4              | 8 KB      | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

インストール完了。

#前にもこの手順でpitをインストールしていて、conda用のパッケージも作成して登録したような気がするんだが、メモとか形跡が何も見当たらない…??

追記)
conda-forgeに登録していた。

conda-forge内のパッケージはGoogle検索には引っかからない(引っかかりにくい)のか?

Leave a comment

Your comment