pip从远程github repo安装tar.gz文件
我为work编写了一个python包,我最初将其发布到PYPI。一切都很完美,我可以pip安装并使用我编写的所有模块。一切都很好。几分钟后,我意识到包中可能有敏感信息,因此未发布,愚蠢的我/新开发人员愚蠢 然后我决定最简单的方法是使用pip从远程github repo安装tar.gz文件,git,github,pip,package,setup.py,Git,Github,Pip,Package,Setup.py,我为work编写了一个python包,我最初将其发布到PYPI。一切都很完美,我可以pip安装并使用我编写的所有模块。一切都很好。几分钟后,我意识到包中可能有敏感信息,因此未发布,愚蠢的我/新开发人员愚蠢 然后我决定最简单的方法是使用tar.gz文件——在运行python3 setup.py sdist bdist_wheel时在dist文件夹中生成——并将其添加到我公司的私有github repo中 我添加了文件并提交,然后尝试了以下命令: pip install git+ssh://git@
tar.gz
文件——在运行python3 setup.py sdist bdist_wheel
时在dist
文件夹中生成——并将其添加到我公司的私有github repo中
我添加了文件并提交,然后尝试了以下命令:
pip install git+ssh://git@github.com/company_github/my_repo.git@commithash
并获取以下错误消息:
ERROR: Command errored out with exit status 1:
command: /Users/me/opt/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/78/bn32jmyx0350cdp7cc_3t2ym0000gn/T/pip-req-build-qqbm6_ox/setup.py'"'"'; __file__='"'"'/private/var/folders/78/bn32jmyx0350cdp7cc_3t2ym0000gn/T/pip-req-build-qqbm6_ox/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/78/bn32jmyx0350cdp7cc_3t2ym0000gn/T/pip-req-build-qqbm6_ox/pip-egg-info
cwd: /private/var/folders/78/bn32jmyx0350cdp7cc_3t2ym0000gn/T/pip-req-build-qqbm6_ox/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/me/opt/anaconda3/lib/python3.7/tokenize.py", line 447, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/78/bn32jmyx0350cdp7cc_3t2ym0000gn/T/pip-req-build-qqbm6_ox/setup.py'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
但是得到一个错误:HTTP错误404
说找不到文件
非常感谢任何帮助或指导
编辑:
以下是文件结构:
.
├── CF_dev_emr_cluster.yaml
├── DeepAR\ Model\ Input\ Check\ (json).ipynb
├── __init__.py
├── anomaly
│ ├── MAD.py
│ └── __init__.py
├── batch_transform
│ ├── batch_transform.py
│ ├── generic_batch_transform.py
│ ├── get_time_series_as_rows.py
│ └── post_batch_transform.py
├── dev_env
│ ├── CF_dev_emr_cluster_m5d.yaml
│ ├── CF_dev_emr_cluster_r5d.yaml
│ └── new_cluster_v2.sh
├── digital_logging.py
├── hive_table_checker
│ ├── __init__.py
│ └── hive_table_checker.py
├── metadata_io
│ ├── README.md
│ ├── __init__.py
│ ├── manage_metadata.py
│ ├── model_record_example.py
│ └── tests
│ ├── __init__.py
│ └── test_manage_metadata.py
├── parquet_converter
│ ├── CF_parquet_emr_cluster_m5d.yaml
│ ├── DAGs
│ │ ├── monthly_parquet_convert_v1.5.py
│ │ ├── monthly_parquet_convert_v1.6.py
│ │ └── utils
│ │ └── check_partitions.py
│ ├── __init__.py
│ ├── dist_parquet_converter.sh
│ ├── dist_parquet_copy.sh
│ ├── dist_spark_parquet_converter.sh
│ ├── parquet_config.json
│ ├── parquet_converter.py
│ ├── parquet_emr_connection_update.sh
│ ├── parquet_final_copy.sh
│ ├── parquet_start_stack.sh
│ ├── patef_schema.json
│ ├── ptef_schema.json
│ └── readme.md
├── pyspark_visualizer
│ └── visualizer.py
├── readme.md
├── setup.py
├── testfile.txt
└── tests
├── __init__.py
├── airflow_testing
│ ├── __init__.py
│ └── dag_test
│ ├── __init__\ 3.py
│ ├── __init__.py
│ ├── test_dag_pytest\ 2.py
│ └── test_dag_pytest.py
├── config.py
└── test_airflow_dags.py
13 directories, 49 files
您可以将tar上传到并使用直接链接进行安装。您的第二种方法应该可以工作。URL可能是错误的,您检查过了吗?可能是这样的,所以我也尝试过这种方法:“ip安装”,但仍然得到一个
HTTP错误404
。但当我转到该链接时,它存在于github repo中。所以我不太清楚为什么会这样。这个存储库是公共的吗。当你在浏览器中注销帐户时,你还能下载.tar.gz
文件吗?这也是一个私人回购协议。如果没有ssh rsa密钥访问权限,我将无法下载它,我的github帐户是从我公司的
.
├── CF_dev_emr_cluster.yaml
├── DeepAR\ Model\ Input\ Check\ (json).ipynb
├── __init__.py
├── anomaly
│ ├── MAD.py
│ └── __init__.py
├── batch_transform
│ ├── batch_transform.py
│ ├── generic_batch_transform.py
│ ├── get_time_series_as_rows.py
│ └── post_batch_transform.py
├── dev_env
│ ├── CF_dev_emr_cluster_m5d.yaml
│ ├── CF_dev_emr_cluster_r5d.yaml
│ └── new_cluster_v2.sh
├── digital_logging.py
├── hive_table_checker
│ ├── __init__.py
│ └── hive_table_checker.py
├── metadata_io
│ ├── README.md
│ ├── __init__.py
│ ├── manage_metadata.py
│ ├── model_record_example.py
│ └── tests
│ ├── __init__.py
│ └── test_manage_metadata.py
├── parquet_converter
│ ├── CF_parquet_emr_cluster_m5d.yaml
│ ├── DAGs
│ │ ├── monthly_parquet_convert_v1.5.py
│ │ ├── monthly_parquet_convert_v1.6.py
│ │ └── utils
│ │ └── check_partitions.py
│ ├── __init__.py
│ ├── dist_parquet_converter.sh
│ ├── dist_parquet_copy.sh
│ ├── dist_spark_parquet_converter.sh
│ ├── parquet_config.json
│ ├── parquet_converter.py
│ ├── parquet_emr_connection_update.sh
│ ├── parquet_final_copy.sh
│ ├── parquet_start_stack.sh
│ ├── patef_schema.json
│ ├── ptef_schema.json
│ └── readme.md
├── pyspark_visualizer
│ └── visualizer.py
├── readme.md
├── setup.py
├── testfile.txt
└── tests
├── __init__.py
├── airflow_testing
│ ├── __init__.py
│ └── dag_test
│ ├── __init__\ 3.py
│ ├── __init__.py
│ ├── test_dag_pytest\ 2.py
│ └── test_dag_pytest.py
├── config.py
└── test_airflow_dags.py
13 directories, 49 files