29

I've followed this Magento DevDocs tutorial to install sample data after installing Magento 2.

But after executing the last command ./bin/magento sampledata:deploy I get the following error:

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - The requested package magento/module-offline-shipping-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 2
    - The requested package magento/module-theme-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 3
    - The requested package magento/module-sales-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 4
    - The requested package magento/module-msrp-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 5
    - The requested package magento/module-sales-rule-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 6
    - The requested package magento/module-configurable-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 7
    - The requested package magento/module-product-links-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 8
    - The requested package magento/module-catalog-rule-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 9
    - The requested package magento/module-grouped-product-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 10
    - The requested package magento/module-tax-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 11
    - The requested package magento/module-catalog-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 12
    - The requested package magento/module-downloadable-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 13
    - The requested package magento/module-cms-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 14
    - The requested package magento/module-bundle-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 15
    - The requested package magento/module-swatches-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 16
    - The requested package magento/module-widget-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 17
    - The requested package magento/module-review-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 18
    - The requested package magento/module-customer-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 19
    - The requested package magento/module-wishlist-sample-data could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Haven't been able to find a solution and to be honest my knowledge of composer is seriously lacking. Any help would be welcome.

1
  • please see @rnli answer. I think which is the best solution so far. It worked for me. Jan 20, 2016 at 7:10

6 Answers 6

19

I've also been struggling to install the sample data. It appears that somthing is currently broken here (Oct 2015) and the instructions in the devdocs didn't work for me either. I was experiencing the same composer issues and the magento sampledata:install isn't even there.

Instead I've been following the "From GitHub Repository" instructions on the sample data's readme file:

Just clone the repo somewhere (can be outside your project folder, since the tool is taking care of symlinking the individual modules):

git clone https://github.com/magento/magento2-sample-data.git ~/sample-data

Then run the "installer" script:

php -f ~/sample-data/dev/tools/build-sample-data.php -- --ce-source="$PATH_TO_YOUR_MAGENTO2_PROJECTROOT"

After that run the update script:

cd $PATH_TO_YOUR_MAGENTO2_PROJECTROOT
bin/magento setup:upgrade

And you should see the sample data being installed (takes a while...):

[...]
Module 'Magento_DownloadableSampleData':
Installing data..
Module 'Magento_ThemeSampleData':
Installing data..
Module 'Magento_OfflineShippingSampleData':
Installing data..
Module 'Magento_ConfigurableSampleData':
Installing data..
Module 'Magento_BundleSampleData':
Installing data..
Module 'Magento_ProductLinksSampleData':
Installing data..
Module 'Magento_ReviewSampleData':
Installing data..
[...]

Don't forget to clear caches and fix permissions and you should see all the sample data in the backend and the frontend now...

1
  • But when I run the setup upgrade, Error PHP Fatal error: Interface 'Magento\Framework\Serialize\SerializerInterface' not found is showing in terminal While SerializerInterface.php file exist. Jul 3, 2017 at 13:34
30

Had the same problem. Fixed with going to the root directory and specifying the repositories for composer with the following command (use https to avoid composer warning):

composer config repositories.magento composer https://repo.magento.com

After that

cd bin
php magento sampledata:deploy

worked as intended

4
  • aha.. beautiful. Worked like a charm Jan 20, 2016 at 7:10
  • this should be added to the install/readme.
    – encodes
    Mar 2, 2016 at 14:41
  • would you mind replacing http with https in the link? When I tried the current form my composer refused to connect to it because it's insecure.
    – peedee
    Mar 28, 2016 at 9:07
  • 1
    composer config repositories.magento composer repo.magento.com/packages.json
    – Nehal
    May 28, 2016 at 7:53
4

Recent code changes make it possible to install sample data using the Magento 2 CE GitHub develop branch provided you clone the Magento 2 and sample data repositories.

This method of installing sample data will be augumented by the time of GA with a command-line option and a Composer option; however, currently, AFAIK, this is the only way to install sample data with the develop branch.

In brief:

  1. Clone the Magento 2 CE GitHub repository (develop branch is the default).
  2. Run 'composer install' from the project root.
  3. Clone the Magento 2 sample data repository (develop branch is the default).
  4. Link the sample data repositories. (php -f sample-data-repo/dev/tools/build-sample-data.php -- --ce-source="your-Magento-CE-install-dir")
  5. Set permissions and ownership in the sample data repository.
  6. Install Magento using either the CLI or Setup Wizard. (Setup Wizard no longer has an Install Sample Data check box.)

Note that if you run the Setup Wizard, you might see exceptions at about 90% complete. If so, set file system permission and ownership again (most likely as root).

Details: http://devdocs.magento.com/guides/v2.0/install-gde/install/web/install-web-sample-data.html

4

In the first section, add "minimum-stability": "beta", before license.

3
  • Did that already but it didn't help, same error Oct 8, 2015 at 13:01
  • sampledata:deploy isn't the name of the command, it's 'magento sampledata:install <your Magento administrator user name>' Oct 9, 2015 at 20:53
  • @SteveJohnson actually I didn't have the install command available Oct 18, 2015 at 10:47
1

https://packages.magento.com is the old package url for Magento change the composer.json file to https://repo.magento.com

0

Just in case you can use this alternative too:

composer config repositories.0 composer https://repo.magento.com

and then:

magento sampledata:deploy

you'll be prompted for username/password : use public_key/private_key from your magento marketplace account

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.