I'm working with Django in a project, I want to use a python function from a project in Github, I can't install this project as a library with pip install dicom-exporter because it doesn' work.
The project I want to use:
the function I want to use :
dicom-exporter <path/to/dicom/folder> <path/to/output.vti>
The project contain setup.py file where there is script entry-point,
Please How can use this project in my django project.
CodePudding user response:
there is a simple way to do this in python
- make sure that the file you want to import your function from is in the same directory as your project
- make sure that the file you are importing the function from isn't named like an already existing python module
- you can import the function into your project by writing into your project:
from [name of the file that contains the function] import [name of the function you want to import]
In this very case though you can simply type in your terminal pip install . as stated here
CodePudding user response:
Its very simple as the Readme file in the project says you would use pip install that ends with a dot. But you will need to open the where you downloaded the project, in its directory contains the Setup.py in your command prompt in other to use the [pip install .], so make sure to download the project clone as a zip file and unzip in to the directory where you will find it in your command prompt and run the pip install .
#First navigate to where the project directory contains the setup.py file in your
# command prompt and run pip install that ends with a dot
pip install .
