Skip to content

Windows compatibility #505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DancingQuanta opened this issue Sep 10, 2016 · 16 comments
Closed

Windows compatibility #505

DancingQuanta opened this issue Sep 10, 2016 · 16 comments

Comments

@DancingQuanta
Copy link

From the README I was warned that this project will not work on Microsoft Windows but nonetheless I am interested on how far can I go with this on Windows and Cygwin using Windows Anaconda Python

Well, could not install from pip from cygwin, what a bore, below is the traceback.

$ pip install khal
Collecting khal
  Using cached khal-0.8.3-py3-none-any.whl
Exception:
Traceback (most recent call last):
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\commands\install.py", line 310, in run
    wb.build(autobuilding=True)
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\wheel.py", line 750, in build
    self.requirement_set.prepare_files(self.finder)
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\req\req_set.py", line 370, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\req\req_set.py", line 587, in _prepare_file
    session=self.session, hashes=hashes)
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\download.py", line 810, in unpack_url
    hashes=hashes
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\download.py", line 653, in unpack_http_url
    unpack_file(from_path, location, content_type, link)
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\utils\__init__.py", line 599, in unpack_file
    flatten=not filename.endswith('.whl')
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\utils\__init__.py", line 499, in unzip_file
    fp = open(fn, 'wb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\cygwin64\\tmp\\pip-build-gfphe0l0\\khal\\khal/aux.py'

The directory where aux.py was expected to be does not exist when I checked to make sure.

Can anyone hazard any interpretion of this error?
What pip and wheel is doing differently on Windows than expected on other system?
Oh and this error is the same in windows as in cygwin if anyone is wondering.

@geier
Copy link
Member

geier commented Sep 11, 2016

To me it looks like something is wrong with the last path, but khal/aux.py isn't hardcoded anywhere. Sorry, I have no idea about windows & python.
Perhaps try to install from the git repository?

@DancingQuanta
Copy link
Author

Couldn't install from git repo because the setuptools-scm could not find
the version of khal. Will post traceback when I see my laptop tonight.

I believe the setup.py is not compatible with Windows.

On 11 Sep 2016 10:25, "Christian Geier" [email protected] wrote:

To me it looks like something is wrong with the last path, but khal/aux.py
isn't hardcoded anywhere. Sorry, I have no idea about windows & python.
Perhaps try to install from the git repository?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#505 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AIB3VSk3Uxyzv4fih6bkjZmgVCxPdsp0ks5qo8kcgaJpZM4J52T8
.

@geier
Copy link
Member

geier commented Sep 11, 2016

@DancingQuanta then perhaps we should start there with windows compat.

@DancingQuanta
Copy link
Author

Yes, I need to understand what makes this setup.py different from the rest
of apps I have been using. Good start would be to understand what pip is
doing.
Or should I look into setuptools-scm first?

On 11 Sep 2016 11:30, "Christian Geier" [email protected] wrote:

@DancingQuanta https://github.com/DancingQuanta then perhaps we should
start there with windows compat.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#505 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AIB3VQKNNpuzY5MIkhIseKyup2afqq1dks5qo9hPgaJpZM4J52T8
.

@DancingQuanta
Copy link
Author

I have tried different ways of installing...

Tried installing via python setup.py install

$ python setup.py install > 1.md
Traceback (most recent call last):
  File "setup.py", line 68, in <module>
    "Topic :: Communications",
  File "C:\Users\andre\Anaconda3\lib\distutils\core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "C:\Users\andre\Anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\s                                          etuptools\dist.py", line 272, in __init__
  File "C:\Users\andre\Anaconda3\lib\distutils\dist.py", line 281, in __init__
    self.finalize_options()
  File "C:\Users\andre\Anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\s                                          etuptools\dist.py", line 327, in finalize_options
  File "c:\users\andre\repos\khal\.eggs\setuptools_scm-1.11.1-py3.5.egg\setuptoo                                          ls_scm\integration.py", line 19, in version_keyword
  File "c:\users\andre\repos\khal\.eggs\setuptools_scm-1.11.1-py3.5.egg\setuptoo                                          ls_scm\__init__.py", line 104, in get_version
  File "c:\users\andre\repos\khal\.eggs\setuptools_scm-1.11.1-py3.5.egg\setuptoo                                          ls_scm\__init__.py", line 82, in _do_parse
LookupError: setuptools-scm was unable to detect version for 'C:\\Users\\andre\\                                          repos\\khal'.

Make sure you're either building from a fully intact git repository or PyPI tarb                                          alls. Most other sources (such as GitHub's tarballs, a git checkout without the                                           .git folder) don't contain the necessary metadata and will not work.

For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj

Using the advice in the error above, I tried

$ pip install git+https://github.com/pimutils/khal.git#egg=khal

Which gives an error

$ pip install git+https://github.com/pimutils/khal.git#egg=khal
Collecting khal from git+https://github.com/pimutils/khal.git#egg=khal
  Cloning https://github.com/pimutils/khal.git to c:\cygwin64\tmp\pip-build-z5zrt049\khal
    Complete output from command python setup.py egg_info:

    Installed c:\cygwin64\tmp\pip-build-z5zrt049\khal\.eggs\setuptools_scm-1.11.1-py3.5.egg
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\cygwin64\tmp\pip-build-z5zrt049\khal\setup.py", line 68, in <module>
        "Topic :: Communications",
      File "C:\Users\andre\Anaconda3\lib\distutils\core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "C:\Users\andre\Anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\setuptools\dist.py", line 272, in __init__
      File "C:\Users\andre\Anaconda3\lib\distutils\dist.py", line 281, in __init__
        self.finalize_options()
      File "C:\Users\andre\Anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\setuptools\dist.py", line 327, in finalize_options
      File "c:\cygwin64\tmp\pip-build-z5zrt049\khal\.eggs\setuptools_scm-1.11.1-py3.5.egg\setuptools_scm\integration.py", line 19, in version_keyword
      File "c:\cygwin64\tmp\pip-build-z5zrt049\khal\.eggs\setuptools_scm-1.11.1-py3.5.egg\setuptools_scm\__init__.py", line 104, in get_version
      File "c:\cygwin64\tmp\pip-build-z5zrt049\khal\.eggs\setuptools_scm-1.11.1-py3.5.egg\setuptools_scm\__init__.py", line 82, in _do_parse
    LookupError: setuptools-scm was unable to detect version for 'C:\\cygwin64\\tmp\\pip-build-z5zrt049\\khal'.

    Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.

    For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj

    ----------------------------------------
Exception:
Traceback (most recent call last):
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\commands\install.py", line 310, in run
    wb.build(autobuilding=True)
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\wheel.py", line 750, in build
    self.requirement_set.prepare_files(self.finder)
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\req\req_set.py", line 370, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\req\req_set.py", line 601, in _prepare_file
    abstract_dist.prep_for_dist()
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\req\req_set.py", line 127, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\req\req_install.py", line 425, in run_egg_info
    command_desc='python setup.py egg_info')
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\utils\__init__.py", line 718, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in C:\cygwin64\tmp\pip-build-z5zrt049\khal\

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\commands\install.py", line 350, in run
    requirement_set.cleanup_files()
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\utils\build.py", line 38, in __exit__
    self.cleanup()
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\utils\build.py", line 42, in cleanup
    rmtree(self.name)
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\_vendor\retrying.py", line 49, in wrapped_f
    return Retrying(*dargs, **dkw).call(f, *args, **kw)
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\_vendor\retrying.py", line 212, in call
    raise attempt.get()
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\_vendor\retrying.py", line 247, in get
    six.reraise(self.value[0], self.value[1], self.value[2])
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\_vendor\six.py", line 686, in reraise
    raise value
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\_vendor\retrying.py", line 200, in call
    attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\utils\__init__.py", line 102, in rmtree
    onerror=rmtree_errorhandler)
  File "C:\Users\andre\Anaconda3\lib\shutil.py", line 488, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "C:\Users\andre\Anaconda3\lib\shutil.py", line 378, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Users\andre\Anaconda3\lib\shutil.py", line 378, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Users\andre\Anaconda3\lib\shutil.py", line 383, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "C:\Users\andre\Anaconda3\lib\site-packages\pip\utils\__init__.py", line 110, in rmtree_errorhandler
    if os.stat(path).st_mode & stat.S_IREAD:
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\cygwin64\\tmp\\pip-build-z5zrt049\\khal\\khal\\aux.py'

The file aux.py still could not be found despite being in the pip-build-z5zrt049.
However noticing the letters of aux.py, it could be the first file to be called for and did not attempt to check other files before throwing an error on missing aux.py.

@DancingQuanta
Copy link
Author

I am trying something today.
First I removed any mention of setuptools-scm so that I can try to install from repo properly.
I ran

python setup.py install

which results in an error of khal/aux.py not existing. The traceback is below

running bdist_egg
running egg_info
creating khal.egg-info
writing entry points to khal.egg-info\entry_points.txt
writing requirements to khal.egg-info\requires.txt
writing top-level names to khal.egg-info\top_level.txt
writing khal.egg-info\PKG-INFO
writing dependency_links to khal.egg-info\dependency_links.txt
writing manifest file 'khal.egg-info\SOURCES.txt'
reading manifest file 'khal.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'CONTRIBUTING.txt'
writing manifest file 'khal.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build
creating build\lib
creating build\lib\khal
error: can't copy 'khal\aux.py': doesn't exist or not a regular file

Why it is trying to copy that file and to where? sites-packages?

Then I renamed the file to aux.py and tried python setup.py install again.
I got khal installed sucessfully. What is going on? Why is the presence of the aux.py file blocking the installation?
Will see if I can copy aux.py to its final place in site-packages if is that where it is supposed to go

@DancingQuanta
Copy link
Author

Just now I tried to rename aux.py to auxi.py and replaced all instances of aux in khal with auxi and ran python setup.py install successfully.
Now the question is, why is the name aux.py python seems to choke on?

@WhyNotHugo
Copy link
Member

It would seem that windows does not support a file named aux.py (!?!?!):

https://bugs.launchpad.net/tensortoolbox/+bug/1400505

@WhyNotHugo
Copy link
Member

WhyNotHugo commented Sep 18, 2016

Wow, aux is a restricted filename on windows (regardless of extension), apparently, cruft from the DOS days:

https://blog.onetechnical.com/2006/11/16/forbidden-file-and-folder-names-on-windows/


My proposal is to rename aux.py to utils.py, if it's okay with everyone else.

@DancingQuanta
Copy link
Author

@hobarrera great find! Renaming the file should fix this.

On otherhand, I should avoid using ikhal on windows as ikhal uses unix specific libraries.

@geier
Copy link
Member

geier commented Sep 19, 2016

nice find! yes, I agree with renaming.

@geier
Copy link
Member

geier commented Sep 19, 2016

done, see 9231796 @geier geier committed a minute ago

@geier
Copy link
Member

geier commented Sep 19, 2016

@DancingQuanta if any more errors occur, please keep reporting them, perhaps we are able to fix them.

@DancingQuanta
Copy link
Author

DancingQuanta commented Sep 20, 2016

@geier Sure. But I do not understand what is the format for datetime that khal can recognise.
Can you give an example of datetime for use of

khal at DATETIME

@DancingQuanta
Copy link
Author

Ah the DATETIME is defined in the khal.conf, I need to remember to use these!

@geier
Copy link
Member

geier commented Sep 20, 2016

yep, error message might need to be improved though. I'll close this, feel free to open new issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants