Speak a variable correctly

Posted on
Fri Nov 25, 2016 11:45 am
norcoscia offline
User avatar
Posts: 1206
Joined: Sep 09, 2015

Re: Speak a variable correctly

Seems to have installed successfully despite the warnings...I reloaded libraries in Indigo, but still get the same error

embedded script: global name 'num2words' is not defined

Code: Select all
$ sudo easy_install pip
Password:
Searching for pip
Reading https://pypi.python.org/simple/pip/
Best match: pip 9.0.1
Downloading https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9
Processing pip-9.0.1.tar.gz
Writing /tmp/easy_install-W_LqQo/pip-9.0.1/setup.cfg
Running pip-9.0.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-W_LqQo/pip-9.0.1/egg-dist-tmp-DDmXwq
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
  warnings.warn(msg)
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.mailmap'
warning: no previously-included files found matching '.travis.yml'
warning: no previously-included files found matching '.landscape.yml'
warning: no previously-included files found matching 'pip/_vendor/Makefile'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files found matching 'dev-requirements.txt'
warning: no previously-included files found matching 'appveyor.yml'
no previously-included directories found matching '.github'
no previously-included directories found matching '.travis'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'contrib'
no previously-included directories found matching 'tasks'
no previously-included directories found matching 'tests'
Adding pip 9.0.1 to easy-install.pth file
Installing pip script to /usr/local/bin
Installing pip2.7 script to /usr/local/bin
Installing pip2 script to /usr/local/bin

Installed /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip

Code: Select all
$ sudo pip install num2words
The directory '/Users/xxxxx/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/xxxxx/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: num2words in /Library/Python/2.7/site-packages/num2words-0.5.4-py2.7.egg

Code: Select all
$ sudo -H pip install num2words
Requirement already satisfied: num2words in /Library/Python/2.7/site-packages/num2words-0.5.4-py2.7.egg

_______
Norm

Posted on
Fri Nov 25, 2016 11:48 am
jay (support) offline
Site Admin
User avatar
Posts: 18221
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Speak a variable correctly

norcoscia wrote:
Code: Select all
$sudo pip install num2words
Password:
sudo: pip: command not found


What OS version are you using? I thought pip was part of the Python 2.7 install but it looks otherwise.

Do this in a terminal window and show the results:

Code: Select all
pip --version


I have a feeling you're among those few that have an odd version of python installed...

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Nov 25, 2016 11:56 am
norcoscia offline
User avatar
Posts: 1206
Joined: Sep 09, 2015

Re: Speak a variable correctly

it returned

Code: Select all
pip 9.0.1 from /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg (python 2.7)


Thx for all the help with this and I apologize for my monkey size brain - I don't know how to learn all of this - it seems overwhelming :-(

_______
Norm

Posted on
Fri Nov 25, 2016 12:06 pm
jay (support) offline
Site Admin
User avatar
Posts: 18221
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Speak a variable correctly

And what OS version?

Restart your Mac and see if that solves the import issue. The message above about ownership may be contributing to the issue as well, not sure.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Nov 25, 2016 12:16 pm
norcoscia offline
User avatar
Posts: 1206
Joined: Sep 09, 2015

Re: Speak a variable correctly

Nope - restart did not help - running El Capitan (10.11.6)

_______
Norm

Posted on
Fri Nov 25, 2016 12:42 pm
jay (support) offline
Site Admin
User avatar
Posts: 18221
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Speak a variable correctly

Run a First Aid on your hard drive using the Disk Utility app. I suspect the permission issues identified above are causing the problem and hopefully that will fix them.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Nov 25, 2016 5:34 pm
norcoscia offline
User avatar
Posts: 1206
Joined: Sep 09, 2015

Re: Speak a variable correctly

In El Capitan (10.11.6) - disk utility no longer includes that function. But I was able to take care of it from the common line - but -- it still did not solve the problem. What I don't understand is why it works fine if I call it from the python interpreter (within the Mac terminal window) but Indigo will not see the num2words library when I try to execute it from within an Indigo trigger.
Attachments
PMGIF.gif
PMGIF.gif (289.51 KiB) Viewed 3337 times

_______
Norm

Posted on
Fri Nov 25, 2016 6:40 pm
DaveL17 offline
User avatar
Posts: 6756
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Speak a variable correctly

Run the following commands in Terminal:
Code: Select all
python --version
<and then>
python2.7 --version

And run these from an Indigo scripting shell:
Code: Select all
python --version
<and then>
which python

and post all the results.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Fri Nov 25, 2016 6:55 pm
norcoscia offline
User avatar
Posts: 1206
Joined: Sep 09, 2015

Re: Speak a variable correctly

From the terminal I get

Code: Select all
python --version
Python 2.7.10


From the Indigo scripting shell I can't run that command (since it is already running Python) - but when I start up the Indigo scripting shell I see:

Code: Select all
Python 2.7.10 (default, Oct 23 2015, 19:19:21)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)]
Connected to Indigo Server v7.0.2, api v2.0 (localhost:1176)

_______
Norm

Posted on
Fri Nov 25, 2016 7:08 pm
DaveL17 offline
User avatar
Posts: 6756
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Speak a variable correctly

What happens when you run:
Code: Select all
Python2.7 --version

in terminal?

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sat Nov 26, 2016 5:52 am
norcoscia offline
User avatar
Posts: 1206
Joined: Sep 09, 2015

Re: Speak a variable correctly

it returns

Code: Select all
Python2.7 --version
Python 2.7.10

_______
Norm

Posted on
Sat Nov 26, 2016 6:04 am
DaveL17 offline
User avatar
Posts: 6756
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Speak a variable correctly

Okay, that's good. It doesn't look like you're suffering from the multiple Python versions that some of us have experienced.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sat Nov 26, 2016 1:46 pm
jay (support) offline
Site Admin
User avatar
Posts: 18221
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Speak a variable correctly

Honestly, I'm out of ideas. If you see this directory:

Code: Select all
/Library/Python/2.7/site-packages/num2words/


Then Indigo should see it as well. Indigo is using the Python that you have installed.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Nov 26, 2016 2:13 pm
norcoscia offline
User avatar
Posts: 1206
Joined: Sep 09, 2015

Re: Speak a variable correctly

I attached a photo - not exactly correct if I understand your question - not sure how to unscrew it if it is messed up - I have already tried to reinstall and it says something like req already satisfied ...
Attachments
2016-11-26_12-09-49.jpeg
2016-11-26_12-09-49.jpeg (64.01 KiB) Viewed 3223 times

_______
Norm

Posted on
Sat Nov 26, 2016 2:33 pm
jay (support) offline
Site Admin
User avatar
Posts: 18221
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Speak a variable correctly

It looks as if num2words isn't installed properly. My guess is because of the permission error. Delete the num2words*.egg file, then run the pip command again and see if that solves the issue.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Who is online

Users browsing this forum: No registered users and 8 guests