Alteryx python tool
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have an error with my python setup in Alteryx.
When I run the code:
from ayx import Alteryx
I get this error:
ImportError: Unable to import required dependencies:
numpy: cannot import name 'machar' from partially initialized module 'numpy.core' (most likely due to a circular import) (C:\Users\[User]\AppData\Roaming\Python\Python38\site-packages\numpy\core\__init__.py)
I've tried a number of things including doing a reinstall of Alteryx, upgrading packages (ayx, pandas, numpy), deleting packages and reinstalling but this error, or variants of it seem to persist.
Any ideas on how to fix?
Here is the full error message for reference:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-2-1d30f7dec1ac> in <module>
----> 1 from ayx import Alteryx
2 #import pandas
c:\program files\alteryx\bin\miniconda3\envs\jupytertool_venv\lib\site-packages\ayx\Alteryx.py in <module>
15 """
16
---> 17 from ayx.export import (
18 __version__,
19 help,
c:\program files\alteryx\bin\miniconda3\envs\jupytertool_venv\lib\site-packages\ayx\export.py in <module>
15 """
16
---> 17 from ayx.CachedData import CachedData as __CachedData__
18 from ayx.Help import Help as __Help__
19 from ayx.Package import installPackages as __installPackages__
c:\program files\alteryx\bin\miniconda3\envs\jupytertool_venv\lib\site-packages\ayx\CachedData.py in <module>
16
17 from uuid import uuid1
---> 18 import pandas as pd
19 from ayx.DatastreamUtils import MetadataTools, Config
20 from ayx.Datafiles import Datafile
~\AppData\Roaming\Python\Python38\site-packages\pandas\__init__.py in <module>
14
15 if _missing_dependencies: # pragma: no cover
---> 16 raise ImportError(
17 "Unable to import required dependencies:\n" + "\n".join(_missing_dependencies)
18 )
ImportError: Unable to import required dependencies:
numpy: cannot import name 'machar' from partially initialized module 'numpy.core' (most likely due to a circular import) (C:\Users\[User]\AppData\Roaming\Python\Python38\site-packages\numpy\core\__init__.py)
Solved! Go to Solution.
- Labels:
- Bug
- Error Message
- Help
- Python
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hi@JAS7703
First, be sure to run Workflow with Admin privilege. Non-admin mode will not be able to import Python library.
Second, be sure that PIP command(Python command for install libraries) is NOT blocked by your company IT.(In our company, PIP is blocked by firewall).
Even if you still face the same error after resolution on the above two things, please once again let us know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Gawa,
Good point, I should have mentioned that I have been running Alteryx in admin mode. I'm pretty sure PIP is working as I am able to install other libraries which don't come with Alteryx such as h3 and openpyxl.
For reference I also get the same error with:
import pandas as pd
import numpy as np
But I do not get this error with other libraries like h3 or openpyxl
i.e.
import h3
works fine.
I've tried reinstalling and upgrading pandas, ayx and numpy, but that hasn't helped
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I checked the past post, but could not find the similar one.
As your error says 'most likely due to a circular import', you can check if any circular import take place or not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I really can’t understand why this would be happening on a fresh install of Alteryx though
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hmm..
When you reinstall Alteryx, not only executing uninstall, but the same time, cleaning up all Alteryx related folders under such as Program data, AppData might be helpful. Otherwise, when installing again Alteryx remembers the previous setting which may repeat the same issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Sadly that hasn't seemed to help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Ok, so I used this to uninstall the packages:
Package.installPackages(['numpy',"pandas],install_type="uninstall")
Then headed here to delete the folders for pandas and numpy:
C:\Users\[User]\AppData\Roaming\Python\Python38\site-packages
Then reinstalled them with this and that seems to have fixed it
Package.installPackages(['pandas','numpy'])
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You can also use !pip install if things go awry. Always worked for me.
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
