0

i have a file that contains a bunch of udf and classes that are common to different projects. I saw in this post that the best way to have one library where all your files pulls from, is to package it. ImportError: No module named <something>

The problem is if I follow the tutorial at some point I must go trhough pypi.org, but the material I'm developping is propriety of my company and i cannot upload it online. https://packaging.python.org/tutorials/packaging-projects/

Is there a way to follow the same steps and package my file as a library locally ? And then install it through pip locally ?

EDIT :

I should have mentioned that I'm using Anaconda. According to their doc :https://docs.conda.io/projects/conda-build/en/latest/user-guide/tutorials/build-pkgs.html

I was able to start a build but now i run into dependencies problems. Probably due to my little understanding of what goes in the meta.yaml file. Here's mine :

{% set name = "EDSE_mapping_func" %}
{% set version = "1.0" %}
package:

  name: "{{ name|lower }}"

  version: "{{ version }}"

source:

  url:
  sha256:

build:

  number: 0

  script: "{{ PYTHON }} -m pip install . --no-deps --ignore-installed -vv "

requirements:
  host:

    - pip

    - python

    - numpy
    - pandas
    - sklearn
    - re
    - string
    - nltk

 run:

   - python

test:


imports:

   - EDSE_mapping_func
about:

 home:

When ever i execute conda build . from the directory where i have my Python file, my meta.yaml and the bld.bat i get the following message :

conda_build.exceptions.DependencyNeedsBuildingError: Unsatisfiable dependencies for platform win-64: {'re', 'sklearn', 'string'}

I've found a piece of solution here, but I don't understand where and how i'm suppose the declare the channels :

Conda Build - creating a Conda package fails on dependencies for platform win-64

Thank you !

Yoan B. M.Sc
  • 1,485
  • 5
  • 18
  • You can package it as a [wheel](https://pythonwheels.com/). – Alex Huszagh Jan 30 '20 at 20:37
  • If you're using setuptools for the project package, you can create a wheel using the following [tutorial](https://packaging.python.org/guides/distributing-packages-using-setuptools/#wheels). Then, you should be able to install it anywhere with that file using pip. – Alex Huszagh Jan 30 '20 at 20:39

0 Answers0