[petsc-users] Error in installation of petsc4py

Barry Smith bsmith at petsc.dev
Thu May 6 14:03:31 CDT 2021


   PETSc folks who know a little bit about Windows Python,

   Does the Microsoft Python environment work with the standard Python setup tools? It seems like it should but ...

   Is the following error coming from the generic use of setup.py on Windows or is it somehow specific to PETSc's use of setup? 

 Running setup.py install for petsc ... error
    ERROR Command errored out with exit status 1
     command 'CProgram FilesPython39python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '''CUsersArashAppDataLocalTemppip-install-2pv0ftutpetsc_718bdaa5c0fd475eb4937d6b87c8c4afsetup.py'''; __file__='''CUsersArashAppDataLocalTemppip-install-2pv0ftutpetsc_718bdaa5c0fd475eb4937d6b87c8c4afsetup.py''';f = getattr(tokenize, '''open''', open)(__file__) if os.path.exists(__file__) else io.StringIO('''from setuptools import setup; setup()''');code = f.read().replace('''rn''', '''n''');f.close();exec(compile(code, __file__, '''exec'''))' install --record 'CUsersArashAppDataLocalTemppip-record-c5j1b3k_install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'CUsersArashAppDataRoamingPythonPython39Includepetsc'
         cwd CUsersArashAppDataLocalTemppip-install-2pv0ftutpetsc_718bdaa5c0fd475eb4937d6b87c8c4af
    Complete output (28 lines)

      The page   https://docs.microsoft.com/en-us/windows/python/faqs <https://docs.microsoft.com/en-us/windows/python/faqs> has the following text:

      To paste a path as a string in Python, add the r prefix. This indicates that it is a raw string, and no escape characters will be used except for \” (you might need to remove the last backslash in your path). So your path might look like:r"C:\Users\MyName\Documents\Document.txt" When working with paths in Python, we recommend using the standard pathlib module. This will let you convert the string to a rich Path object that can do path manipulations consistently whether it uses forward slashes or backslashes, making your codework better across different operating systems.

     Should we/can we convert PETSc's configure and setup.py to use pathlib (and maybe need to add some r in places) to fully support using Microsoft Python and the Microsoft way of handling file systems? 

   Thanks for any input,

   Barry

We've never supported using the Microsoft Python environment and always used cygwin python in the past.

 


> On May 6, 2021, at 1:19 PM, Satish Balay via petsc-users <petsc-users at mcs.anl.gov> wrote:
> 
> Is this on windows with windows python? This likely won't work.
> 
> Can you use WSL?
> 
> Satish
> 
> On Thu, 6 May 2021, Matthew Knepley wrote:
> 
>> The error is in your script:
>> 
>>   'CProgram' is not recognized as an internal or external command,
>> 
>> 
>>  Matt
>> 
>> On Thu, May 6, 2021 at 2:09 PM arash rezaei <arashrezaei96 at gmail.com> wrote:
>> 
>>> Hello,
>>> I want to install pets4py
>>> I use this command:
>>> 
>>> python -m pip install [--user] petsc petsc4py
>>> 
>>> 
>> 
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210506/7de58a6b/attachment.html>


More information about the petsc-users mailing list