Namespace packages and pip install -e

2024/11/15 10:20:51

I have a ns.pkg2 package that depends on ns.pkg1 package. I make a fork of it, publish it to git and want to install my version into my virtualenv. I use pip install -e mygit and end up with ns.pkg in <env>/local/lib/python2.7/site-packages/ns/pkg1 and ns.pkg2 in <env>/src/ns.pkg2 with an <env>/lib/python2.7/site-packages/ns.pkg2.egg-link. Now I can import ns and ns.pkg1 but not ns.pkg2. I couldn't find a way to install a package from git without pip install -e that calls setup.py develop. Also, I'm not sure it's not a problem with module code.

So, is it possible to co-install two modules from the same namespace from a tarball and directly from git?

Answer

There is an open issue in pip related to --editable and namespace installations: https://github.com/pypa/pip/issues/3

A workaround was merged, and maybe you can solve your problem by doing:

$ pip install -e mygit --egg
https://en.xdnf.cn/q/71962.html

Related Q&A

Python sys.argv out of range, dont understand why

I have a script that Ive been using for a some time to easily upload files to my server. It has been working great for a long time, but I cant get it to work on my new desktop computer. The code is sim…

Error calling BashOperator: Bash command failed

Here are my dag file and BashOperator task:my_dag = { dag_id = my_dag, start_date = datetime(year=2017, month=3, day=28), schedule_interval=01***, }my_bash_task = BashOperator( task_id="my_bash_t…

Match unescaped quotes in quoted csv

Ive looked at several of the Stack Overflow posts with similar titles, and none of the accepted answers have done the trick for me.I have a CSV file where each "cell" of data is delimited by …

Creating RDF file using csv file as input

I need to convert a csv file to rdf with rdflib, I already have the code that reads the csv but I do not know how to convert it to rdf.I have the following code:import csv from rdflib.graph import Grap…

Explicit vertex position in python graph-tool

I am using python graph-tool. To draw graphs, it uses graph_draw function. I want to send vertex positions explicitly to dot engine. It turns out that I can pass a property map named pos. I tried defin…

Add jar to pyspark when using notebook

Im trying the mongodb hadoop integration with spark but cant figure out how to make the jars accessible to an IPython notebook.Here what Im trying to do:# set up parameters for reading from MongoDB via…

how do I create a python list with a negative index

Im new to python and need to create a list with a negative index but have not been successful so far.Im using this code:a = [] for i in xrange( -20, 0, -1 ):a[i] = -(i)log.info(a[{i}]={v}.format(i=i, v…

Select subset of Data Frame rows based on a list in Pandas

I have a data frame df1 and list x:In [22] : import pandas as pd In [23]: df1 = pd.DataFrame({C: range(5), "B":range(10,20,2), "A":list(abcde)}) In [24]: df1 Out[24]:A B C 0 a …

convert csv to json (nested objects)

I am new to python, and I am having to convert a csv file to json in following format:CSV File :firstname, lastname, email, customerid, dateadded, customerstatus john, doe, [email protected], 124,26/11…

How can I read exactly one response chunk with pythons http.client?

Using http.client in Python 3.3+ (or any other builtin python HTTP client library), how can I read a chunked HTTP response exactly one HTTP chunk at a time?Im extending an existing test fixture (writt…