Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Tony

Pages: 1 ... 26 27 [28] 29 30 ... 37
406
Hi Heather,

ok, we're getting somewhere now! This problem is caused by numpy being built with a manifest resource, which it shouldn't have. This is related to this bug:
http://bugs.python.org/issue4120

This effectively makes it impossible to import numpy in any application that doesn't have the correct manifest also embedded (like Excel).

What version of EPD are you using? I spoke to someone at Enthought about this some time ago, and it should have been fixed in EPD 7 I believe. If you are using 7 or later please let me know so I can follow up with Enthought.

The only solution I know of to fix this without changing the build of numpy is to manually remove the manifest resource from the affected .pyd files manually using a tool like CFF Explorer:
http://www.ntcore.com/exsuite.php

If you delete the resource from all the numpy .pyd files then they will import correctly without giving those errors.

Thanks for your patience with this.

Best regards,
Tony

407
Hi Heather,

can you try installing "Microsoft Visual C++ 2008 Service Pack 1 Redistributable Package" from this microsoft link?
http://support.microsoft.com/kb/2019667

This should normally get installed with Python 2.7, and some builds of numpy require it to be included in the application manifest - which stops it being able to be imported when python is embedded in anything that uses a different runtime (like versions of Excel other than 2010).

Best regards,
Tony


408
Hi Heather,

oh ok, I suspect that installing EPD installed the microsoft c runtime alongside the python executable, and that's why it works now. The normal python installer installs that in the windows system folder, so the python folder doesn't need to be on the path. I remember now though that the EPD installer works differently.

PyXLL doesn't use the python.exe executable, it only uses the python dll. You can have multiple python installations and PyXLL will work. As long as it can find the right version of the python dll on the PATH (or in the same folder as the xll) it will pick it up. The python dlls are named including the version number (eg python27.dll) so there's no problem having multiple versions installed at the same time. You need to have the right build of pyxll for the version of python you're using though (you can select which version you want on the download page).

Glad you managed to get it working. Please let me know if you need anything else.

Best regards,
Tony

409
Hi Heather,

is there anything in the log file?

That error suggests there was still a problem importing the pyxll module :(

Best regards,
Tony

410
Hi,

ah, ok. It looks like the pythonpath is set with relative paths (eg .\lib etc). This works when you run python.exe as those paths are relative to that executable, but when run from Excel it won't work as the python directory isn't the current working directory. You need to change the pythonpath to use absolute paths instead. You can do that either by setting the environment variable PYTHONPATH, or by changing the pythonpath settings in the registry (HKEY_LOCAL_MACHINE -> SOFTWARE -> Python -> PythonCore -> [ Version Number ] -> PythonPath).

Best regards,
Tony

411
Hi Heather,

can you try the latest beta version 2.0.3 please? You can download it from http://beta.pyxll.com. It fixes a couple of problems and gives more warnings/errors if there's anything wrong. You should make sure you remove all previous versions first.

I've not tried the combination of XP and 2013, but pyxll does work with 2013 and Windows 8, although it's not as well tested as with 2003/2007/2010.

Best regards,
Tony

412
Help and Support / Re: Error and Traceback - Please give solution
« on: February 21, 2013, 06:55:32 PM »
Hi Vijay,

that's probably better asked on more general python programming forums, or a numpy forum, than here. There are also some examples included with pyxll which might be helpful to get you started.

Best regards,
Tony

413
Help and Support / Re: Error and Traceback - Please give solution
« on: February 21, 2013, 05:52:28 PM »
x is a 2d array of numbers (list of lists) as you are using the float[] type. You can't do arithmetic operations on lists of lists.

Change the type of x to 'float' and return a numpy array, as below:

import numpy as np

@xl_func("float x: numpy_row")
def VPCombustionenthalpytmp1(x):
    """returns array of factors for processing enthtmp
    x: Float[] x
    """
    return np.array([(x-60),(x**2-3600),(x**3-216000),(x**4-12960000)])

Best regards,
Tony

414
Hi Vijay,

that's only part of the log - I suspect the error is elsewhere in the log file. From your code it looks like you're trying to multiply a numpy array by a list; that may be what's causing you problems.

Best regards,
Tony

415
Help and Support / Re: Error and Traceback - Please give solution
« on: February 21, 2013, 04:20:15 PM »
Hi Vijay,

looks like you're returning a list when a numpy array is expected.

Best regards,
Tony

416
Hi Vijay,

you need to check the log file for errors. I expect your code is raising an exception and that is why you are getting #NUM! back. You should see the stack trace and the exception in the log file.

Best regards,
Tony

417
Hi,

is numpy installed and importing correctly? Please can you check the log file to see if any errors are being reported there?

best regards,
Tony

418
Help and Support / Re: Errors on Reload PyXLL
« on: February 11, 2013, 06:49:08 PM »
Hi,

'test' is the name of a builtin python module. Could you try renaming your module something else and see if you have the same problem please?

Best regards,
Tony

419
Help and Support / Re: multiple addins / excel crash
« on: February 10, 2013, 09:04:17 PM »
Hi Bill,

this should be working again now. Please can you try downloading the new build of 2.0.3 from http://beta.pyxll.com?

Apologies for this bug, and thanks for reporting it. Do let me know if it still isn't working for you or if you have any other problems.

Best regards,
Tony

420
Help and Support / Re: multiple addins / excel crash
« on: February 08, 2013, 03:03:04 PM »
Hi,

I've just checked this, and I can see it is indeed not working in the current version. This is a bug as it is intended to work.

I'll investigate further and get it fixed for you as soon as possible.

Best regards,
Tony

Pages: 1 ... 26 27 [28] 29 30 ... 37