Caster icon indicating copy to clipboard operation
Caster copied to clipboard

Pip Install Bug

Open ethangoldstein opened this issue 5 years ago • 8 comments

I tried installing caster through PIP. I got the following error.

Generic Exception: Traceback (most recent call last): File "c:\users\egoldste\appdata\local\temp\pip-install-rf5jki\castervoice\post_setup.py", line 39, in setup shutil.copy("_caster.py", directory) File "c:\python27\lib\shutil.py", line 119, in copy copyfile(src, dst) File "c:\python27\lib\shutil.py", line 69, in copyfile raise Error("%s and %s are the same file" % (src, dst)) Error: _caster.py and .\_caster.py are the same file

Caster: Report Error to https://github.com/dictation-toolbox/caster/issues

Close window to continue

c:\users\egoldste\appdata\local\temp\pip-install-rf5jki\castervoice>

When I rerun the PIP command, PIP thinks that caster has been installed correctly and does not attempt to fix this problem. I had to delete caster from python manually to reproduce this error.

ethangoldstein avatar Oct 07 '19 19:10 ethangoldstein

Thanks for reporting this issue! The PIP install this very alpha and won't go live until the ccr rewrite and a couple of other features.

So the PIP uninstall did not properly remove the package?

Self Note error handling

try:
    shutil.copy(src, dst)
except shutil.SameFileError:

LexiconCode avatar Oct 07 '19 20:10 LexiconCode

Sorry, I wasn't clear. While the PIP uninstall did not work properly, I was able to remove the package by simply deleting the castervoice folder from the Python2 directory.

ethangoldstein avatar Oct 08 '19 01:10 ethangoldstein

@ethangoldstein

Could you try executing the following in your Python environment? The following code should print the absolute path to your natlink user directory.

import natlinkstatus
status = natlinkstatus.NatlinkStatus()
directory = status.getUserDirectory()
print directory 

The current code checks to see if the path is valid however the source and destination path could be the same and valid. It looks to me that status.getUserDirectory failed producing an empty path. Thus explaining .\_caster.py.

LexiconCode avatar Oct 08 '19 01:10 LexiconCode

The results are:

UserDirectory: . . [Finished in 1.3s]

ethangoldstein avatar Oct 09 '19 17:10 ethangoldstein

@ethangoldstein That would be the issue status.getUserDirectory() is returning a blank path.

What version of Natlink do you have installed? What is your current Natlink UserDirectory absolute path via Configure Natlink via GUI? image

LexiconCode avatar Oct 09 '19 20:10 LexiconCode

Untitled

ethangoldstein avatar Oct 15 '19 02:10 ethangoldstein

@ethangoldstein Update to natlink-4.2

rerun to test

import natlinkstatus
status = natlinkstatus.NatlinkStatus()
directory = status.getUserDirectory()
print directory 

LexiconCode avatar Nov 16 '19 02:11 LexiconCode

This error also occurs if you try to use python setup.py install. So some further error handling is needed.

However however the post install script is trying to address where to place _caster.py so that natlink or other engine loaders can load Caster.

LexiconCode avatar Dec 19 '19 13:12 LexiconCode