Skip to content

add proper conda env support for RunPython #954

@timeregained

Description

@timeregained

OS (e.g. Windows 10 or macOS Sierra)

Windows 10 64bit 1709

Versions of xlwings, Excel and Python (e.g. 0.11.8, Office 365, Python 3.7)

0.12.1(xlwings-0.12.1-py37_0), Office 365, Python 3.7 distributed by anaconda(python-3.7.0-hea74fb7_0)

Describe your issue (incl. Traceback!)

When I click Run button of simulation.xlsm in this repo's eamples, an import error occurs which having flowing traceback:

Traceback (most recent call last):
File "", line 1, in 
File "C:\Users\someone\AppData\Local\Continuum\miniconda3\lib\site-packages\numpy_init_.py", line 142, in 
from . import add_newdocs
File "C:\Users\someone\AppData\Local\Continuum\miniconda3\lib\site-packages\numpy\add_newdocs.py", line 13, in 
from numpy.lib import add_newdoc
File "C:\Users\someone\AppData\Local\Continuum\miniconda3\lib\site-packages\numpy\lib_init_.py", line 8, in 
from .type_check import *
File "C:\Users\someone\AppData\Local\Continuum\miniconda3\lib\site-packages\numpy\lib\type_check.py", line 11, in 
import numpy.core.numeric as nx
File "C:\Users\someone\AppData\Local\Continuum\miniconda3\lib\site-packages\numpy\core_init.py", line 26, in 
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try git clean -xdf (removes all
files not under version control). Otherwise reinstall numpy.

This issue only happened when I have upgraded python from 3.6 to 3.7 within anaconda. So I have created an issue #10205 in anaconda-issues which has been soon closed by anaconda engineer. As his description:

I removed a hack deep in the guts of our python recently whereby it modified the PATH environment variable if it detected activation may not have happened correctly. This breaks countless things in 3rd party software.

I have no choice but wish your team would follow the change to make xlwings working again if scripts using some numpy function.

Include a minimal code sample to reproduce the issue (and attach a sample workbook if required!)

Just the demo simulation could repeat this issue.

It seems only related to scripts which has involve numpy now, but it might bring same issues to some other 3rd packages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions